Update j178/prek-action action to v3 (#386) #1025
This file contains hidden or 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.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - trunk | |
| workflow_dispatch: | |
| permissions: {} | |
| defaults: | |
| run: | |
| shell: bash | |
| env: | |
| CARGO_TERM_COLOR: always | |
| ROW_COLOR: always | |
| CLICOLOR: 1 | |
| jobs: | |
| unit_test: | |
| name: Unit test [${{ matrix.mode }}-${{ matrix.os }}] | |
| runs-on: ${{ matrix.os }} | |
| permissions: | |
| contents: read | |
| strategy: | |
| matrix: | |
| os: | |
| - ubuntu-24.04 | |
| - macos-26 | |
| mode: | |
| - debug | |
| include: | |
| - os: ubuntu-24.04 | |
| mode: release | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Configure Rust | |
| id: rust_toolchain | |
| uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 | |
| with: | |
| toolchain: 1.97.1 | |
| - name: Cache | |
| uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 | |
| with: | |
| key: ${{ matrix.mode }} | |
| cache-bin: false | |
| - 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-24.04 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Configure Rust | |
| id: rust_toolchain | |
| uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 | |
| with: | |
| toolchain: 1.97.1 | |
| - name: Cache | |
| uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 | |
| with: | |
| cache-bin: false | |
| - 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@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | |
| with: | |
| python-version: "3.14" | |
| - name: Set up Python environment | |
| uses: glotzerlab/workflows/setup-uv@00c67cb577c36bdc2570845fc62d1a30e3383012 # 0.14.0 | |
| with: | |
| lockfile: ".github/workflows/signac-requirements.txt" | |
| - name: Run signac.sh | |
| run: bash signac.sh | |
| working-directory: doc/src/guide/signac | |
| env: | |
| ROW_YES: "true" | |
| build_documentation: | |
| name: Build documentation | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Set up mdbook | |
| uses: glotzerlab/workflows/setup-mdbook@00c67cb577c36bdc2570845fc62d1a30e3383012 # 0.14.0 | |
| with: | |
| mdbook_version: 0.5.4 | |
| - name: Build documentation | |
| run: mdbook build doc | |
| env: | |
| RUST_LOG: "mdbook=info" | |
| tests_complete: | |
| name: All tests | |
| if: always() | |
| needs: [unit_test, execute_tutorials, build_documentation] | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - run: jq --exit-status 'all(.result == "success")' <<< "${NEEDS}" | |
| env: | |
| NEEDS: ${{ toJson(needs) }} | |
| - run: exit 0 |