|
5 | 5 | # - hack: check combinations of feature flags |
6 | 6 | # - msrv: check that the msrv specified in the crate is correct |
7 | 7 | permissions: |
8 | | - contents: read |
| 8 | + contents: read |
9 | 9 | # This configuration allows maintainers of this repo to create a branch and pull request based on |
10 | 10 | # the new branch. Restricting the push trigger to the main branch ensures that the PR only gets |
11 | 11 | # built once. |
12 | 12 | on: |
13 | | - push: |
14 | | - branches: [main] |
15 | | - pull_request: |
| 13 | + push: |
| 14 | + branches: [main] |
| 15 | + pull_request: |
16 | 16 | # If new code is pushed to a PR branch, then cancel in progress workflows for that PR. Ensures that |
17 | 17 | # we don't waste CI time, and returns results quicker https://github.com/jonhoo/rust-ci-conf/pull/5 |
18 | 18 | concurrency: |
19 | | - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} |
20 | | - cancel-in-progress: true |
| 19 | + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} |
| 20 | + cancel-in-progress: true |
21 | 21 | name: check |
22 | 22 | jobs: |
23 | | - fmt: |
24 | | - runs-on: ubuntu-latest |
25 | | - name: stable / fmt |
26 | | - steps: |
27 | | - - uses: actions/checkout@v4 |
28 | | - with: |
29 | | - submodules: true |
30 | | - - name: Install stable |
31 | | - uses: dtolnay/rust-toolchain@stable |
32 | | - with: |
33 | | - components: rustfmt |
34 | | - - name: cargo fmt --check |
35 | | - run: cargo fmt --check |
36 | | - clippy: |
37 | | - runs-on: ubuntu-latest |
38 | | - name: ${{ matrix.toolchain }} / clippy |
39 | | - permissions: |
40 | | - contents: read |
41 | | - checks: write |
42 | | - strategy: |
43 | | - fail-fast: false |
44 | | - matrix: |
45 | | - # Get early warning of new lints which are regularly introduced in beta channels. |
46 | | - toolchain: [stable, beta] |
47 | | - steps: |
48 | | - - uses: actions/checkout@v4 |
49 | | - with: |
50 | | - submodules: true |
51 | | - - name: Install ${{ matrix.toolchain }} |
52 | | - uses: dtolnay/rust-toolchain@master |
53 | | - with: |
54 | | - toolchain: ${{ matrix.toolchain }} |
55 | | - components: clippy |
56 | | - - name: cargo clippy |
57 | | - uses: giraffate/clippy-action@v1 |
58 | | - with: |
59 | | - reporter: 'github-pr-check' |
60 | | - github_token: ${{ secrets.GITHUB_TOKEN }} |
61 | | - hack: |
62 | | - # cargo-hack checks combinations of feature flags to ensure that features are all additive |
63 | | - # which is required for feature unification |
64 | | - runs-on: ubuntu-latest |
65 | | - name: ubuntu / stable / features |
66 | | - steps: |
67 | | - - uses: actions/checkout@v4 |
68 | | - with: |
69 | | - submodules: true |
70 | | - - name: Install stable |
71 | | - uses: dtolnay/rust-toolchain@stable |
72 | | - - name: cargo install cargo-hack |
73 | | - uses: taiki-e/install-action@cargo-hack |
74 | | - # intentionally no target specifier; see https://github.com/jonhoo/rust-ci-conf/pull/4 |
75 | | - # --feature-powerset runs for every combination of features |
76 | | - - name: cargo hack |
77 | | - run: cargo hack --feature-powerset check |
78 | | - msrv: |
79 | | - # check that we can build using the minimal rust version that is specified by this crate |
80 | | - runs-on: ubuntu-latest |
81 | | - # we use a matrix here just because env can't be used in job names |
82 | | - # https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability |
83 | | - strategy: |
84 | | - matrix: |
85 | | - msrv: ["1.81"] |
86 | | - name: ubuntu / ${{ matrix.msrv }} |
87 | | - steps: |
88 | | - - uses: actions/checkout@v4 |
89 | | - with: |
90 | | - submodules: true |
91 | | - - name: Install ${{ matrix.msrv }} |
92 | | - uses: dtolnay/rust-toolchain@master |
93 | | - with: |
94 | | - toolchain: ${{ matrix.msrv }} |
95 | | - - name: cargo +${{ matrix.msrv }} check |
96 | | - run: cargo check |
| 23 | + fmt: |
| 24 | + runs-on: ubuntu-latest |
| 25 | + name: stable / fmt |
| 26 | + steps: |
| 27 | + - uses: actions/checkout@v4 |
| 28 | + with: |
| 29 | + submodules: true |
| 30 | + - name: Install stable |
| 31 | + uses: dtolnay/rust-toolchain@stable |
| 32 | + with: |
| 33 | + components: rustfmt |
| 34 | + - name: cargo fmt --check |
| 35 | + run: cargo fmt --check |
| 36 | + clippy: |
| 37 | + runs-on: ubuntu-latest |
| 38 | + name: ${{ matrix.toolchain }} / clippy |
| 39 | + permissions: |
| 40 | + contents: read |
| 41 | + checks: write |
| 42 | + strategy: |
| 43 | + fail-fast: false |
| 44 | + matrix: |
| 45 | + # Get early warning of new lints which are regularly introduced in beta channels. |
| 46 | + toolchain: [stable, beta] |
| 47 | + steps: |
| 48 | + - uses: actions/checkout@v4 |
| 49 | + with: |
| 50 | + submodules: true |
| 51 | + - name: Install ${{ matrix.toolchain }} |
| 52 | + uses: dtolnay/rust-toolchain@master |
| 53 | + with: |
| 54 | + toolchain: ${{ matrix.toolchain }} |
| 55 | + components: clippy |
| 56 | + - name: cargo clippy |
| 57 | + uses: giraffate/clippy-action@v1 |
| 58 | + with: |
| 59 | + reporter: "github-pr-check" |
| 60 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 61 | + hack: |
| 62 | + # cargo-hack checks combinations of feature flags to ensure that features are all additive |
| 63 | + # which is required for feature unification |
| 64 | + runs-on: ubuntu-latest |
| 65 | + name: ubuntu / stable / features |
| 66 | + steps: |
| 67 | + - uses: actions/checkout@v4 |
| 68 | + with: |
| 69 | + submodules: true |
| 70 | + - name: Install stable |
| 71 | + uses: dtolnay/rust-toolchain@stable |
| 72 | + - name: cargo install cargo-hack |
| 73 | + uses: taiki-e/install-action@cargo-hack |
| 74 | + # intentionally no target specifier; see https://github.com/jonhoo/rust-ci-conf/pull/4 |
| 75 | + # --feature-powerset runs for every combination of features |
| 76 | + - name: cargo hack |
| 77 | + run: cargo hack --feature-powerset check |
| 78 | + msrv: |
| 79 | + # check that we can build using the minimal rust version that is specified by this crate |
| 80 | + runs-on: ubuntu-latest |
| 81 | + # we use a matrix here just because env can't be used in job names |
| 82 | + # https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability |
| 83 | + strategy: |
| 84 | + matrix: |
| 85 | + msrv: ["1.86"] |
| 86 | + name: ubuntu / ${{ matrix.msrv }} |
| 87 | + steps: |
| 88 | + - uses: actions/checkout@v4 |
| 89 | + with: |
| 90 | + submodules: true |
| 91 | + - name: Install ${{ matrix.msrv }} |
| 92 | + uses: dtolnay/rust-toolchain@master |
| 93 | + with: |
| 94 | + toolchain: ${{ matrix.msrv }} |
| 95 | + - name: cargo +${{ matrix.msrv }} check |
| 96 | + run: cargo check |
0 commit comments