Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed Oct 8, 2024
1 parent c64e52a commit 31b5447
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: CI
on:
pull_request:
merge_group:
push:

env:
MDBOOK_VERSION: 0.4.40
Expand Down Expand Up @@ -98,6 +99,34 @@ jobs:
working-directory: ./mdbook-spec
run: cargo fmt --check

preview:
# if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Update rustup
run: rustup self update
- name: Install Rust
run: |
rustup set profile minimal
rustup toolchain install nightly
rustup default nightly
- name: Install mdbook
run: |
mkdir bin
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v${MDBOOK_VERSION}/mdbook-v${MDBOOK_VERSION}-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
echo "$(pwd)/bin" >> $GITHUB_PATH
- name: Build the book
env:
SPEC_RELATIVE: 0
run: mdbook build
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: preview-${{ github.event.pull_request.number }}
overwrite: true
path: book/**

# The success job is here to consolidate the total success/failure state of
# all other jobs. This job is then included in the GitHub branch protection
# rule which prevents merges unless all other jobs are passing. This makes
Expand All @@ -110,6 +139,7 @@ jobs:
- code-tests
- style-tests
- mdbook-spec
# preview is explicitly excluded here since we don't care if it fails
runs-on: ubuntu-latest
steps:
- run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
Expand Down

0 comments on commit 31b5447

Please sign in to comment.