Fix tutorial #134
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: test | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
on: | |
pull_request: | |
push: | |
branches: | |
- trunk | |
workflow_dispatch: | |
defaults: | |
run: | |
shell: bash | |
env: | |
CARGO_TERM_COLOR: always | |
ROW_COLOR: always | |
CLICOLOR: 1 | |
MDBOOK_VERSION: 0.4.40 | |
LINKCHECK_VERSION: 0.7.7 | |
RUST_LATEST_VERSION: 1.78.0 | |
BUNDLE_LICENSES_VERSION: 1.3.0 | |
jobs: | |
unit_test: | |
name: Unit test [${{ matrix.mode }}-rust-${{ matrix.rust }}-${{ matrix.os }}] | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: | |
- ubuntu-22.04 | |
- macos-14 | |
rust: | |
# Oldest supported version of rust | |
- 1.77.2 | |
- 1.78.0 | |
mode: | |
- debug | |
include: | |
# Add a release build on linux with the latest version of rust | |
- os: ubuntu-22.04 | |
rust: 1.78.0 | |
mode: release | |
steps: | |
- uses: actions/checkout@v4.1.6 | |
- name: Update rust | |
run: rustup install ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }} | |
- name: Check rust installation | |
run: rustc -vV | |
- uses: actions/cache@v4.0.2 | |
with: | |
path: | | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-rust-${{ matrix.rust }}-cargo-unit-test-${{ matrix.mode }}-${{ hashFiles('**/Cargo.lock') }} | |
- name: Build | |
run: cargo build ${{ matrix.mode == 'release' && '--release' || '' }} --verbose | |
- name: Run tests | |
run: cargo test ${{ matrix.mode == 'release' && '--release' || '' }} --verbose | |
execute_tutorials: | |
name: Execute tutorials | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4.1.6 | |
- name: Update rust | |
run: rustup install "$RUST_LATEST_VERSION" --no-self-update && rustup default "$RUST_LATEST_VERSION" | |
- name: Check rust installation | |
run: rustc -vV | |
- uses: actions/cache@v4.0.2 | |
with: | |
path: | | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-rust-${{ env.RUST_LATEST_VERSION }}-cargo-execute-tutorials-${{ hashFiles('**/Cargo.lock') }} | |
- name: Install | |
run: cargo install --path . --locked --verbose | |
- name: Run hello.sh | |
run: bash hello.sh | |
working-directory: doc/src/guide/tutorial | |
env: | |
ROW_YES: "true" | |
- name: Run group.sh | |
run: bash group.sh | |
working-directory: doc/src/guide/tutorial | |
env: | |
ROW_YES: "true" | |
# The signac test requires python | |
- name: Set up Python | |
uses: actions/setup-python@v5.1.0 | |
with: | |
python-version: '3.12' | |
- run: pip install -r .github/workflows/signac-requirements.txt | |
- name: Run signac.sh | |
run: bash signac.sh | |
working-directory: doc/src/guide/python | |
env: | |
ROW_YES: "true" | |
build_documentation: | |
name: Build documentation | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4.1.6 | |
- name: Install mdbook | |
run: | | |
mkdir -p "$HOME/.cargo/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 -xvz --directory "$HOME/.cargo/bin" | |
- name: Install mdbook-linkcheck | |
run: | | |
curl -sSL "https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/download/v$LINKCHECK_VERSION/mdbook-linkcheck.x86_64-unknown-linux-gnu.zip" -o mdbook-linkcheck.zip | |
unzip mdbook-linkcheck.zip -d "$HOME/.cargo/bin" | |
chmod a+x "$HOME/.cargo/bin/mdbook-linkcheck" | |
- name: Add linkcheck configuration | |
run: | | |
echo -e "[output.linkcheck]\nfollow-web-links=true" >> doc/book.toml | |
cat doc/book.toml | |
- name: Build documentation | |
run: mdbook build doc | |
env: | |
RUST_LOG: "mdbook=info,linkcheck=warn,reqwest=debug" | |
- name: Install cargo-bundle-licenses | |
run: | | |
curl -sSL "https://github.com/sstadick/cargo-bundle-licenses/releases/download/v$BUNDLE_LICENSES_VERSION/cargo-bundle-licenses-linux-amd64" -o "$HOME/.cargo/bin/cargo-bundle-licenses" | |
chmod a+x "$HOME/.cargo/bin/cargo-bundle-licenses" | |
- name: Check bundled licenses | |
run: cargo bundle-licenses --format yaml --output CI.yaml --previous THIRDPARTY.yaml --check-previous | |
tests_complete: | |
name: All tests | |
if: always() | |
needs: [unit_test, execute_tutorials, build_documentation] | |
runs-on: ubuntu-latest | |
steps: | |
- run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}' | |
- name: Done | |
run: exit 0 |