|
5 | 5 |
|
6 | 6 | name: Continuous integration
|
7 | 7 |
|
| 8 | +env: |
| 9 | + CARGO_TERM_COLOR: always |
| 10 | + |
8 | 11 | jobs:
|
| 12 | + # On Linux, we check that the crate builds and links for all the toolchains and targets. |
9 | 13 | ci-linux:
|
10 |
| - runs-on: ubuntu-20.04 |
11 |
| - continue-on-error: ${{ matrix.experimental || false }} |
12 | 14 | strategy:
|
13 | 15 | matrix:
|
14 | 16 | # All generated code should be running on stable now, MRSV is 1.59.0
|
15 |
| - rust: [nightly, stable, 1.59.0] |
16 |
| - |
| 17 | + toolchain: [ stable, nightly, 1.59.0 ] |
| 18 | + target: |
| 19 | + - x86_64-unknown-linux-gnu |
| 20 | + - riscv32i-unknown-none-elf |
| 21 | + - riscv32imc-unknown-none-elf |
| 22 | + - riscv32imac-unknown-none-elf |
| 23 | + - riscv64gc-unknown-linux-gnu |
| 24 | + - riscv64gc-unknown-none-elf |
| 25 | + cargo_flags: [ "--no-default-features", "--all-features" ] |
17 | 26 | include:
|
18 | 27 | # Nightly is only for reference and allowed to fail
|
19 | 28 | - rust: nightly
|
20 | 29 | experimental: true
|
21 |
| - |
| 30 | + runs-on: ubuntu-latest |
| 31 | + continue-on-error: ${{ matrix.experimental || false }} |
22 | 32 | steps:
|
23 |
| - - uses: actions/checkout@v2 |
24 |
| - - uses: actions-rs/toolchain@v1 |
25 |
| - with: |
26 |
| - profile: minimal |
27 |
| - toolchain: ${{ matrix.rust }} |
28 |
| - override: true |
29 |
| - - name: Install all Rust targets for ${{ matrix.rust }} |
30 |
| - run: rustup target install --toolchain=${{ matrix.rust }} x86_64-unknown-linux-gnu riscv32imac-unknown-none-elf riscv64imac-unknown-none-elf riscv64gc-unknown-none-elf |
31 |
| - - name: Install riscv gcc |
32 |
| - run: sudo apt-get update && sudo apt-get install -y gcc-riscv64-unknown-elf |
33 |
| - - name: Run CI script for x86_64-unknown-linux-gnu under ${{ matrix.rust }} |
34 |
| - run: cargo check --target x86_64-unknown-linux-gnu |
35 |
| - - name: Run CI script for riscv32imac-unknown-none-elf under ${{ matrix.rust }} |
36 |
| - run: cargo check --target riscv32imac-unknown-none-elf |
37 |
| - - name: Run CI script for riscv64imac-unknown-none-elf under ${{ matrix.rust }} |
38 |
| - run: cargo check --target riscv64imac-unknown-none-elf |
39 |
| - - name: Run CI script for riscv64gc-unknown-none-elf under ${{ matrix.rust }} |
40 |
| - run: cargo check --target riscv64gc-unknown-none-elf |
41 |
| - - name: Run CI script for x86_64-unknown-linux-gnu under ${{ matrix.rust }} with critical-section-single-hart |
42 |
| - run: cargo check --target x86_64-unknown-linux-gnu --features critical-section-single-hart |
43 |
| - - name: Run CI script for riscv32imac-unknown-none-elf under ${{ matrix.rust }} with critical-section-single-hart |
44 |
| - run: cargo check --target riscv32imac-unknown-none-elf --features critical-section-single-hart |
45 |
| - - name: Run CI script for riscv64imac-unknown-none-elf under ${{ matrix.rust }} with critical-section-single-hart |
46 |
| - run: cargo check --target riscv64imac-unknown-none-elf --features critical-section-single-hart |
47 |
| - - name: Run CI script for riscv64gc-unknown-none-elf under ${{ matrix.rust }} with critical-section-single-hart |
48 |
| - run: cargo check --target riscv64gc-unknown-none-elf --features critical-section-single-hart |
49 |
| - |
| 33 | + - uses: actions/checkout@v3 |
| 34 | + - uses: dtolnay/rust-toolchain@master |
| 35 | + with: |
| 36 | + toolchain: ${{ matrix.toolchain }} |
| 37 | + targets: ${{ matrix.target }} |
| 38 | + - name: Build library |
| 39 | + run: cargo build --target ${{ matrix.target }} ${{ matrix.cargo_flags }} |
| 40 | + |
50 | 41 | # On macOS and Windows, we at least make sure that the crate builds and links.
|
51 |
| - build-other: |
| 42 | + ci-others: |
52 | 43 | strategy:
|
53 | 44 | matrix:
|
54 | 45 | os:
|
55 | 46 | - macOS-latest
|
56 | 47 | - windows-latest
|
| 48 | + cargo_flags: [ "--no-default-features", "--all-features" ] |
57 | 49 | runs-on: ${{ matrix.os }}
|
58 |
| - |
59 | 50 | steps:
|
60 |
| - - uses: actions/checkout@v2 |
61 |
| - - uses: actions-rs/toolchain@v1 |
62 |
| - with: |
63 |
| - profile: minimal |
64 |
| - toolchain: stable |
65 |
| - override: true |
| 51 | + - uses: actions/checkout@v3 |
| 52 | + - uses: dtolnay/rust-toolchain@stable |
66 | 53 | - name: Build crate for host OS
|
67 |
| - run: cargo build --features critical-section-single-hart |
| 54 | + run: cargo build ${{ matrix.cargo_flags }} |
0 commit comments