|
14 | 14 | CARGO_TERM_COLOR: always |
15 | 15 |
|
16 | 16 | jobs: |
17 | | - build_stable: |
18 | | - |
| 17 | + build: |
| 18 | + strategy: |
| 19 | + matrix: |
| 20 | + rust: [ stable, beta, nightly ] |
| 21 | + include: |
| 22 | + - rust: nightly |
| 23 | + check_cfg: '-Zcheck-cfg' |
19 | 24 | runs-on: ubuntu-latest |
20 | | - |
21 | 25 | steps: |
22 | | - - uses: actions/checkout@v2 |
23 | | - - uses: actions-rs/toolchain@v1 |
24 | | - with: |
25 | | - toolchain: stable |
| 26 | + - uses: actions/checkout@v4 |
| 27 | + - name: Set up Rust toolchain |
| 28 | + run: | |
| 29 | + rustup toolchain install --no-self-update --profile minimal ${{ matrix.rust }} |
| 30 | + rustup default ${{ matrix.rust }} |
| 31 | + # Add a big endian target so we can check that everything at least |
| 32 | + # compiles on big endian. |
| 33 | + rustup target add --toolchain ${{ matrix.rust }} powerpc64-unknown-linux-gnu |
26 | 34 | - name: Build |
27 | | - run: cargo build --verbose --all |
| 35 | + run: cargo build --verbose --all ${{ matrix.check_cfg }} |
28 | 36 | - name: Run tests |
29 | | - run: cargo test --verbose --all |
| 37 | + run: cargo test --verbose --all ${{ matrix.check_cfg }} |
30 | 38 | - name: Docs |
31 | | - run: cargo doc --verbose --all |
32 | | - |
33 | | - build_beta: |
34 | | - runs-on: ubuntu-latest |
35 | | - |
36 | | - steps: |
37 | | - - uses: actions/checkout@v2 |
38 | | - - uses: actions-rs/toolchain@v1 |
39 | | - with: |
40 | | - toolchain: beta |
41 | | - override: true |
42 | | - - uses: actions-rs/cargo@v1 |
43 | | - with: |
44 | | - command: build |
45 | | - args: --verbose --all |
46 | | - - uses: actions-rs/cargo@v1 |
47 | | - with: |
48 | | - command: test |
49 | | - args: --verbose --all |
50 | | - - uses: actions-rs/cargo@v1 |
51 | | - with: |
52 | | - command: doc |
53 | | - args: --verbose --all |
54 | | - |
55 | | - build_nightly: |
56 | | - runs-on: ubuntu-latest |
57 | | - |
58 | | - steps: |
59 | | - - uses: actions/checkout@v2 |
60 | | - - uses: actions-rs/toolchain@v1 |
61 | | - with: |
62 | | - toolchain: nightly |
63 | | - override: true |
64 | | - - uses: actions-rs/cargo@v1 |
65 | | - with: |
66 | | - command: build |
67 | | - args: --verbose --all -Zcheck-cfg |
68 | | - - uses: actions-rs/cargo@v1 |
69 | | - with: |
70 | | - command: test |
71 | | - args: --verbose --all -Zcheck-cfg |
72 | | - - uses: actions-rs/cargo@v1 |
73 | | - with: |
74 | | - command: doc |
75 | | - args: --verbose --all |
76 | | - |
77 | | - check_big_endian: |
78 | | - runs-on: ubuntu-latest |
79 | | - |
80 | | - steps: |
81 | | - - uses: actions/checkout@v2 |
82 | | - - uses: actions-rs/toolchain@v1 |
83 | | - with: |
84 | | - toolchain: stable |
85 | | - target: powerpc64-unknown-linux-gnu |
86 | | - override: true |
87 | | - - uses: actions-rs/cargo@v1 |
88 | | - with: |
89 | | - command: check |
90 | | - args: --verbose --lib --bins --tests |
| 39 | + run: cargo doc --verbose --no-deps |
| 40 | + - name: Check big endian |
| 41 | + run: cargo check --target powerpc64-unknown-linux-gnu --verbose --all |
91 | 42 |
|
92 | 43 | # These jobs doesn't actually test anything, but they're only used to tell |
93 | 44 | # bors the build completed, as there is no practical way to detect when a |
|
97 | 48 | end-success: |
98 | 49 | name: bors build finished |
99 | 50 | runs-on: ubuntu-latest |
100 | | - needs: [build_stable, build_beta, build_nightly, check_big_endian] |
| 51 | + needs: [build] |
101 | 52 | if: github.event.pusher.name == 'bors' && success() |
102 | 53 | steps: |
103 | 54 | - name: mark the job as a success |
|
106 | 57 | end-failure: |
107 | 58 | name: bors build finished |
108 | 59 | runs-on: ubuntu-latest |
109 | | - needs: [build_stable, build_beta, build_nightly, check_big_endian] |
| 60 | + needs: [build] |
110 | 61 | if: github.event.pusher.name == 'bors' && (failure() || cancelled()) |
111 | 62 | steps: |
112 | 63 | - name: mark the job as a failure |
|
0 commit comments