This repository was archived by the owner on Apr 15, 2026. It is now read-only.
Target specs v3, github closed it #398
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: push | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| workflow_dispatch: | |
| env: | |
| # For setup-rust, see https://github.com/moonrepo/setup-rust/issues/22 | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| jobs: | |
| test-os: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| - macos-latest | |
| - windows-latest | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| RUST_LOG: debug | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: cargo-bins/cargo-binstall@main | |
| - run: cargo binstall cargo-nextest | |
| - run: cargo fetch --locked | |
| - name: shader-crate-template cargo fetch --locked | |
| run: | | |
| cd ./crates/shader-crate-template | |
| cargo fetch --locked | |
| - run: cargo nextest run | |
| - name: Run a full build | |
| run: cargo xtask test-build | |
| test-rust-gpu-releases: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| rust-gpu-version: | |
| # As well as testing on each OS, we also want to test to make sure we're still supporting | |
| # older versions of `rust-gpu`. However, we can assume that these tests are already okay | |
| # across platforms, so we only need to test on Linux, the chepeast in terms of minutes. | |
| # | |
| # `0.7.0` currently fails building `spirv-builder-cli` with: | |
| # """ | |
| # package `is_terminal_polyfill v1.70.1` cannot be built because it requires rustc | |
| # 1.70.0 or newer, while the currently active rustc version is 1.69.0-nightly | |
| # """ | |
| # It's probably easily fixable. But also `0.7.0` was released in April 2023, so there's | |
| # unlikely many users of it? | |
| - 0.8.0 | |
| - 0.9.0 | |
| # target spec introduction | |
| # last version before | |
| - cc752312c3de6813a41189e46476d5c1be5e0bbe | |
| # first version | |
| - 02cefd101014f66b79dffb20a2c2b5b7c9038401 | |
| # target specs change again just a few commits later | |
| - bbb61f58b3d24f3f64745050eb214b90bf6dcce9 | |
| # just after target specs v2 refactor | |
| # before | |
| - a547c6e45266d613d9fec673e869d7a96181e47b | |
| # after | |
| - 2326b87fe1542eeb898065e36ac949307b55386d | |
| runs-on: ubuntu-latest | |
| env: | |
| RUST_LOG: debug | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Run a full build | |
| run: cargo xtask test-build --rust-gpu-version ${{ matrix.rust-gpu-version }} | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: cargo-bins/cargo-binstall@main | |
| - run: cargo binstall cargo-shear | |
| - run: cargo fetch --locked | |
| - run: cargo clippy -- --deny warnings | |
| - run: cargo fmt --check | |
| - run: cargo shear | |
| # This allows us to have a single job we can branch protect on, rather than needing | |
| # to update the branch protection rules when the test matrix changes | |
| test_success: | |
| runs-on: ubuntu-24.04 | |
| needs: [test-os, test-rust-gpu-releases, lint] | |
| # Hack for buggy GitHub Actions behavior with skipped checks: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks | |
| if: ${{ always() }} | |
| steps: | |
| # Another hack is to actually check the status of the dependencies or else it'll fall through | |
| - run: | | |
| echo "Checking statuses..." | |
| [[ "${{ needs.test-os.result }}" == "success" ]] || exit 1 | |
| [[ "${{ needs.test-rust-gpu-releases.result }}" == "success" ]] || exit 1 | |
| [[ "${{ needs.lint.result }}" == "success" ]] || exit 1 | |
| defaults: | |
| run: | |
| shell: bash |