Files
wgpu/.github/workflows/pipeline.yml
Jim Blandy fd83816945 Add . to the workspace's default members. Test with no features.
Naga is now a workspace with `naga` and `cli` as its two members. The default
package for cargo commands is `cli`, so that `cargo run` will just run the CLI.

However, this has a few unexpected consequences:

- Now `cargo test` will just try to run `cli`'s tests, of which there are none.
  Adding `"."` to the `default-members` list in the workspace's `Cargo.toml`
  seems to fix this, without breaking `cargo run`.

- Even with `"."` added to `default-members`, `cargo test` will build `naga` by
  default with the features requested for it in `cli/Cargo.toml`: all the front
  and back ends, but no `serialize` or `deserialize`. This means that our CI job
  meant to verify no-feature builds isn't doing that job any more. We need to
  pass `--package naga` to `cargo test` to make it test naga directly.
2021-06-16 13:53:00 -04:00

51 lines
1.4 KiB
YAML

# Regular testing.
name: pipeline
on: [push, pull_request]
jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
rust: [1.43.0, nightly]
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- uses: actions-rs/cargo@v1
name: Default test
with:
# 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.
command: test
args: --package naga
- uses: actions-rs/cargo@v1
name: Test all features
with:
command: test
args: --all-features --workspace
- name: Check snapshots
run: git diff --exit-code -- tests/out
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: rustup component add clippy
- uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-features --workspace -- -D warnings