summaryrefslogtreecommitdiffstats
path: root/third_party/rust/naga/.github/workflows/ci.yml
blob: ce951216b955e6a2176df28a9f0f94546af2f41c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
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