Skip to content

Commit 3725747

Browse files
Fixes MacOS nightly; Introduces nightly mdbook build (#380)
Nightly MacOS test runs were failing due to the updated integration test structure recently introduced to the project. Part of these changes addresses that situation. The other part of the changes introduces an mdbook nightly build. This does not publish the documentation, it only checks to make sure that mdbook+plugins can install and build the documentation properly. I believe it was necessary because the only time documentation is built is when a release happens, and if documentation generation fails for whatever reason, we find out only after a release has been published. The hope is that this should catch any errors before we release. NOTE: This PR wants to be merged into tcdi/plrust:main directly, as it is only CI changes and the nightly updates can be applied immediately instead of waiting for another plrust release.
1 parent 2eaa9ee commit 3725747

File tree

1 file changed

+68
-7
lines changed

1 file changed

+68
-7
lines changed

.github/workflows/nightly.yml

Lines changed: 68 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ jobs:
277277
psql -h 127.0.0.1 -U postgres -c 'SELECT * FROM plrust.one()'
278278
279279
plrust_macos_x86_64:
280-
name: macos x86_64 tests
280+
name: (nightly) MacOS x86_64 tests
281281
runs-on: ${{ matrix.os }}
282282
if: "!contains(github.event.head_commit.message, 'nogha')"
283283

@@ -357,13 +357,74 @@ jobs:
357357
- name: Install plrustc
358358
run: cd plrustc && ./build.sh && cp ../build/bin/plrustc ~/.cargo/bin
359359

360-
- name: Run 'cargo pgrx init' against system-level ${{ matrix.version }}
360+
- name: Run cargo pgrx init
361361
run: cargo pgrx init --pg$PG_VER $(which pg_config)
362362

363-
- name: Test PL/rust as "untrusted"
364-
if: matrix.target == 'host'
365-
run: cargo test --all --features "pg$PG_VER" --no-default-features
363+
- name: Install PL/Rust as "trusted"
364+
if: matrix.target == 'postgrestd'
365+
run: cd plrust && STD_TARGETS="x86_64-apple-darwin-postgres" ./build && echo "\q" | cargo pgrx run "pg$PG_VER" --features "trusted"
366+
367+
- name: Test PL/Rust package as "trusted"
368+
if: matrix.target == 'postgrestd'
369+
run: cd plrust && cargo test --no-default-features --features "pg$PG_VER trusted"
366370

367-
- name: Test PL/rust as "trusted" (inc. postgrestd)
371+
- name: Run PL/Rust integration tests as "trusted"
368372
if: matrix.target == 'postgrestd'
369-
run: cd plrust && STD_TARGETS="x86_64-apple-darwin-postgres" ./build && cargo test --verbose --no-default-features --features "pg$PG_VER trusted"
373+
run: cd plrust && echo "\q" | cargo pgrx run "pg$PG_VER" --features "trusted" && cd ../plrust-tests && cargo test --no-default-features --features "pg$PG_VER trusted"
374+
375+
- name: Install PL/Rust as "untrusted"
376+
if: matrix.target == 'host'
377+
run: cd plrust && STD_TARGETS="x86_64-apple-darwin-postgres" ./build && echo "\q" | cargo pgrx run "pg$PG_VER"
378+
379+
- name: Test PL/Rust package as "untrusted"
380+
if: matrix.target == 'host'
381+
run: cd plrust && cargo test --no-default-features --features "pg$PG_VER"
382+
383+
- name: Run PL/Rust integration tests as "untrusted"
384+
if: matrix.target == 'host'
385+
run: cd plrust && echo "\q" | cargo pgrx run "pg$PG_VER" && cd ../plrust-tests && cargo test --no-default-features --features "pg$PG_VER"
386+
387+
test_mdbook:
388+
name: (nightly) Test that mdbook can process the documentation correctly
389+
runs-on: [ubuntu-latest]
390+
defaults:
391+
run:
392+
shell: bash
393+
394+
strategy:
395+
fail-fast: false
396+
397+
env:
398+
CI: true
399+
400+
steps:
401+
# If this workflow is being called from a schedule/cron job, then let's
402+
# force the "develop" branch. Otherwise, use whatever is passed in via
403+
# GITHUB_HEAD_REF. The result of this will be used below in the
404+
# actions/checkout@vX step. Note that at the time of this writing, Github
405+
# Actions does not allow us to specify which branch to run a schedule from
406+
# (it always runs from the default branch, which in this case is master).
407+
- name: Set up correct branch environment variable
408+
run: |
409+
if [ $GITHUB_EVENT_NAME == "schedule" ]; then
410+
echo "Running via schedule, so using branch develop"
411+
echo "NIGHTLY_BUILD_REF=develop" >> $GITHUB_ENV
412+
else
413+
echo "Not running via schedule, so using branch $GITHUB_HEAD_REF"
414+
echo "NIGHTLY_BUILD_REF=$GITHUB_HEAD_REF" >> $GITHUB_ENV
415+
fi
416+
417+
- uses: actions/checkout@v3
418+
with:
419+
ref: ${{ env.NIGHTLY_BUILD_REF }}
420+
421+
- name: Install Rust
422+
run: |
423+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
424+
echo "PATH=$HOME/.cargo/bin:$PATH" >> $GITHUB_ENV
425+
426+
- name: Install mdbook and other preprocessors
427+
run: cargo install --locked mdbook-variables mdbook
428+
429+
- name: Build documentation
430+
run: cd doc && mdbook build

0 commit comments

Comments
 (0)