4
4
pull_request :
5
5
merge_group :
6
6
7
- name : Run macro tests (tests )
7
+ name : Run tests (build and trybuild )
8
8
9
9
jobs :
10
- run-tests :
10
+ run-trybuild :
11
11
strategy :
12
12
matrix :
13
13
os : [ macos-latest, ubuntu-latest ] # windows shows weird linking errors
@@ -16,12 +16,62 @@ jobs:
16
16
- uses : actions/checkout@v4
17
17
- uses : dtolnay/rust-toolchain@stable
18
18
- name : Run tests
19
- run : cargo test --package tests
19
+ run : cargo test --package tests-trybuild
20
+ run-build :
21
+ strategy :
22
+ matrix :
23
+ # All generated code should be running on stable now, MRSV is 1.61.0
24
+ toolchain : [ stable, nightly, 1.61.0 ]
25
+ target :
26
+ - riscv32i-unknown-none-elf
27
+ - riscv32im-unknown-none-elf
28
+ - riscv32imc-unknown-none-elf
29
+ - riscv32imac-unknown-none-elf
30
+ - riscv32imafc-unknown-none-elf
31
+ - riscv64imac-unknown-none-elf
32
+ - riscv64gc-unknown-none-elf
33
+ example :
34
+ - empty
35
+ include :
36
+ # Nightly is only for reference and allowed to fail
37
+ - toolchain : nightly
38
+ experimental : true
39
+ exclude :
40
+ - toolchain : 1.61.0
41
+ target : riscv32im-unknown-none-elf
42
+ - toolchain : 1.61.0
43
+ target : riscv32imafc-unknown-none-elf
44
+ runs-on : ubuntu-latest
45
+ continue-on-error : ${{ matrix.experimental || false }}
46
+ steps :
47
+ - uses : actions/checkout@v4
48
+ - uses : dtolnay/rust-toolchain@master
49
+ with :
50
+ toolchain : ${{ matrix.toolchain }}
51
+ targets : ${{ matrix.target }}
52
+ - name : Build (no features)
53
+ run : RUSTFLAGS="-C link-arg=-Tdevice.x -C link-arg=-Tmemory.x -C link-arg=-Tlink.x" cargo build --package tests-build --target ${{ matrix.target }} --example ${{ matrix.example }}
54
+ - name : Build (include device.x)
55
+ run : RUSTFLAGS="-C link-arg=-Tmemory.x -C link-arg=-Tlink.x" cargo build --package tests-build --target ${{ matrix.target }} --example ${{ matrix.example }} --features device
56
+ - name : Build (include memory.x)
57
+ run : RUSTFLAGS="-C link-arg=-Tdevice.x -C link-arg=-Tlink.x" cargo build --package tests-build --target ${{ matrix.target }} --example ${{ matrix.example }} --features memory
58
+ - name : Build (include device.x and memory.x)
59
+ run : RUSTFLAGS="-C link-arg=-Tlink.x" cargo build --package tests-build --target ${{ matrix.target }} --example ${{ matrix.example }} --features device,memory
60
+
61
+ - name : Build (custom interrupts and exceptions)
62
+ run : RUSTFLAGS="-C link-arg=-Tdevice.x -C link-arg=-Tmemory.x -C link-arg=-Tlink.x" cargo build --package tests-build --target ${{ matrix.target }} --example ${{ matrix.example }} --features no-interrupts,no-exceptions
63
+ - name : Build (custom interrupts and exceptions, include device.x)
64
+ run : RUSTFLAGS="-C link-arg=-Tmemory.x -C link-arg=-Tlink.x" cargo build --package tests-build --target ${{ matrix.target }} --example ${{ matrix.example }} --features no-interrupts,no-exceptions,device
65
+ - name : Build (custom interrupts and exceptions, include memory.x)
66
+ run : RUSTFLAGS="-C link-arg=-Tdevice.x -C link-arg=-Tlink.x" cargo build --package tests-build --target ${{ matrix.target }} --example ${{ matrix.example }} --features no-interrupts,no-exceptions,memory
67
+ - name : Build (custom interrupts and exceptions, include device.x and memory.x)
68
+ run : RUSTFLAGS="-C link-arg=-Tlink.x" cargo build --package tests-build --target ${{ matrix.target }} --example ${{ matrix.example }} --features no-interrupts,no-exceptions,device,memory
20
69
21
70
# Job to check that all the builds succeeded
22
71
tests-check :
23
72
needs :
24
- - run-tests
73
+ - run-trybuild
74
+ - run-build
25
75
runs-on : ubuntu-latest
26
76
if : always()
27
77
steps :
0 commit comments