diff options
Diffstat (limited to 'third_party/rust/naga/.github/workflows/ci.yml')
-rw-r--r-- | third_party/rust/naga/.github/workflows/ci.yml | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/third_party/rust/naga/.github/workflows/ci.yml b/third_party/rust/naga/.github/workflows/ci.yml new file mode 100644 index 0000000000..ce951216b9 --- /dev/null +++ b/third_party/rust/naga/.github/workflows/ci.yml @@ -0,0 +1,94 @@ +name: CI +on: [push, pull_request] + +env: + CARGO_INCREMENTAL: false + CARGO_TERM_COLOR: always + RUST_BACKTRACE: full + MSRV: 1.63 + +jobs: + check-msrv: + name: Check MSRV and minimal-versions + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Install MSRV toolchain + run: rustup toolchain install $MSRV --no-self-update --profile=minimal --component clippy + + - name: Install nightly toolchain + run: rustup toolchain install nightly --no-self-update --profile=minimal + + - name: Install cargo-hack + uses: taiki-e/install-action@v2 + with: + tool: cargo-hack + + # -Z avoid-dev-deps doesn't work + - run: cargo +nightly hack generate-lockfile --remove-dev-deps -Z minimal-versions --offline + + - name: Test all features + run: cargo +$MSRV clippy --all-features --workspace -- -D warnings + + test: + name: Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Install cargo-nextest and cargo-llvm-cov + uses: taiki-e/install-action@v2 + with: + tool: cargo-nextest,cargo-llvm-cov + + - name: Default test + # Our intention here is to test `naga` with no features enabled. But + # since `cli` is the default package, a plain `cargo test` will build + # `naga` with the features requested in `cli/Cargo.toml`. Passing + # `--package naga` causes us to use the default features in the + # top-level `Cargo.toml` instead. + run: cargo nextest run --package naga + + - name: Test all features + run: cargo llvm-cov --lcov --output-path lcov.info nextest --all-features --workspace + + - name: Upload coverage report to codecov + uses: codecov/codecov-action@v3 + with: + files: lcov.info + + - name: Check snapshots + run: git diff --exit-code -- tests/out + + check: + name: Check benchmarks and naga-fuzz + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Check benchmarks + run: cargo check --benches + + - name: Check naga-fuzz + run: | + cd fuzz + cargo check + + documentation: + name: Documentation + runs-on: ubuntu-latest + env: + RUSTDOCFLAGS: -Dwarnings + steps: + - uses: actions/checkout@v3 + + - run: cargo doc -p naga --all-features --document-private-items + + fmt: + name: Format + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - run: cargo fmt -- --check |