Skip to content

Commit e36fdc0

Browse files
committed
Isolate try-build tests from riscv-rt
1 parent 5e211cd commit e36fdc0

33 files changed

+85
-67
lines changed

.github/workflows/riscv-rt.yaml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
name: Build check (riscv-rt)
88

99
jobs:
10-
build:
10+
build-riscv:
1111
strategy:
1212
matrix:
1313
# All generated code should be running on stable now, MRSV is 1.61.0
@@ -43,11 +43,25 @@ jobs:
4343
run: RUSTFLAGS="-C link-arg=-Triscv-rt/examples/device.x" cargo build --package riscv-rt --target ${{ matrix.target }} --example ${{ matrix.example }} --features=v-trap
4444
- name: Build (all features)
4545
run: RUSTFLAGS="-C link-arg=-Triscv-rt/examples/device.x" cargo build --package riscv-rt --target ${{ matrix.target }} --example ${{ matrix.example }} --features=s-mode,single-hart,v-trap
46-
46+
47+
build-others:
48+
strategy:
49+
matrix:
50+
os: [ macos-latest, ubuntu-latest, windows-latest ]
51+
runs-on: ${{ matrix.os }}
52+
steps:
53+
- uses: actions/checkout@v4
54+
- uses: dtolnay/rust-toolchain@stable
55+
- name: Build (no features)
56+
run: cargo build --package riscv-rt
57+
- name: Build (all features)
58+
run: cargo build --package riscv-rt --all-features
59+
4760
# Job to check that all the builds succeeded
4861
build-check:
4962
needs:
50-
- build
63+
- build-riscv
64+
- build-others
5165
runs-on: ubuntu-latest
5266
if: always()
5367
steps:

.github/workflows/tests.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
on:
2+
push:
3+
branches: [ master ]
4+
pull_request:
5+
merge_group:
6+
7+
name: Run macro tests (tests)
8+
9+
jobs:
10+
run-tests:
11+
strategy:
12+
matrix:
13+
os: [ macos-latest, ubuntu-latest, windows-latest ]
14+
runs-on: ${{ matrix.os }}
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: dtolnay/rust-toolchain@nightly
18+
- name: Run tests
19+
run: cargo test --package tests
20+
21+
# Job to check that all the builds succeeded
22+
tests-check:
23+
needs:
24+
- run-tests
25+
runs-on: ubuntu-latest
26+
if: always()
27+
steps:
28+
- run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ members = [
66
"riscv-peripheral",
77
"riscv-rt",
88
"riscv-semihosting",
9+
"tests",
910
]

riscv-rt/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ riscv-pac = { path = "../riscv-pac", version = "0.2.0" }
2525
riscv-rt-macros = { path = "macros", version = "0.2.1" }
2626

2727
[dev-dependencies]
28-
trybuild = "1.0"
2928
panic-halt = "0.2.0"
3029

3130
[features]

riscv-rt/examples/empty.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#![no_main]
33

44
extern crate panic_halt;
5-
extern crate riscv_rt;
65

76
use riscv_rt::{core_interrupt, entry, exception, external_interrupt};
87

riscv-rt/examples/multi_core.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
#![no_main]
33

44
extern crate panic_halt;
5-
extern crate riscv;
6-
extern crate riscv_rt;
75

86
use riscv::asm::wfi;
97
use riscv::register::{mie, mip};

riscv-rt/macros/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#![deny(warnings)]
22

3+
extern crate core;
4+
extern crate proc_macro;
5+
extern crate proc_macro2;
6+
extern crate quote;
7+
extern crate syn;
8+
39
use proc_macro2::{Span, TokenStream as TokenStream2};
410
use quote::quote;
511
use syn::{

riscv-rt/tests/test.rs

Lines changed: 0 additions & 6 deletions
This file was deleted.

riscv-rt/tests/ui/external_interrupt/fail_arguments.rs

Lines changed: 0 additions & 31 deletions
This file was deleted.

riscv-rt/tests/ui/external_interrupt/fail_arguments.stderr

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)