summaryrefslogtreecommitdiffstats
path: root/third_party/rust/naga/.github/workflows/pipeline.yml
blob: 46c427ee0f38dbb472f14c8795f5da535baf875e (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
95
96
97
98
99
100
# Regular testing.
name: pipeline
on: [push, pull_request]

jobs:
  test-msrv:
    name: Test MSRV and dependencies minimal-versions
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: "1.56.0"
          override: true
      - uses: taiki-e/install-action@cargo-hack
      - uses: taiki-e/install-action@cargo-minimal-versions
      # nightly is only used by cargo-minimal-versions to regenerate the lock file
      - run: rustup toolchain add nightly --no-self-update
      - name: Test all features
        run: cargo minimal-versions test --all-features --workspace
      - name: Check snapshots
        run: git diff --exit-code -- tests/out
  test:
    name: Test Nightly
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: nightly
          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
      - uses: actions-rs/cargo@v1
        name: Check benchmarks
        with:
          command: check
          args: --benches
  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
  documentation:
    name: Documentation
    runs-on: ubuntu-latest
    env:
      RUSTDOCFLAGS: -Dwarnings
    steps:
      - uses: actions/checkout@v2
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true
      - uses: actions-rs/cargo@v1
        with:
          command: doc
          args: -p naga --all-features --document-private-items
  fmt:
    name: Format
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true
          components: rustfmt
      - name: run rustfmt
        run: |
          cargo fmt -- --check