Skip to content

Commit 3555ba9

Browse files
Update ci.yaml
1 parent 864bce2 commit 3555ba9

File tree

1 file changed

+28
-41
lines changed

1 file changed

+28
-41
lines changed

.github/workflows/ci.yaml

Lines changed: 28 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -5,63 +5,50 @@ on:
55

66
name: Continuous integration
77

8+
env:
9+
CARGO_TERM_COLOR: always
10+
811
jobs:
12+
# On Linux, we check that the crate builds and links for all the toolchains and targets.
913
ci-linux:
10-
runs-on: ubuntu-20.04
11-
continue-on-error: ${{ matrix.experimental || false }}
1214
strategy:
1315
matrix:
1416
# 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" ]
1726
include:
1827
# Nightly is only for reference and allowed to fail
1928
- rust: nightly
2029
experimental: true
21-
30+
runs-on: ubuntu-latest
31+
continue-on-error: ${{ matrix.experimental || false }}
2232
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+
5041
# On macOS and Windows, we at least make sure that the crate builds and links.
51-
build-other:
42+
ci-others:
5243
strategy:
5344
matrix:
5445
os:
5546
- macOS-latest
5647
- windows-latest
48+
cargo_flags: [ "--no-default-features", "--all-features" ]
5749
runs-on: ${{ matrix.os }}
58-
5950
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
6653
- 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

Comments
 (0)