Skip to content

Commit edf4dac

Browse files
committed
separation of CI
1 parent 612d58d commit edf4dac

File tree

4 files changed

+51
-40
lines changed

4 files changed

+51
-40
lines changed

.github/workflows/clippy.yaml

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
on:
22
push:
3-
branches: [ master, add-riscv-rt ]
3+
branches: [ master ]
44
pull_request:
55
merge_group:
66

@@ -14,28 +14,46 @@ jobs:
1414
strategy:
1515
matrix:
1616
toolchain: [ stable, nightly ]
17-
cargo_flags:
18-
- "--no-default-features"
19-
- "--all-features"
2017
include:
2118
# Nightly is only for reference and allowed to fail
2219
- toolchain: nightly
2320
experimental: true
2421
runs-on: ubuntu-latest
2522
continue-on-error: ${{ matrix.experimental || false }}
2623
steps:
27-
- uses: actions/checkout@v3
24+
- uses: actions/checkout@v4
2825
- uses: dtolnay/rust-toolchain@master
2926
with:
3027
toolchain: ${{ matrix.toolchain }}
3128
components: clippy
32-
- name: Run clippy
33-
run: cargo clippy --all ${{ matrix.cargo_flags }} -- -D warnings
29+
- name: Run clippy (no features)
30+
run: cargo clippy --all --no-default-features -- -D warnings
31+
- name: Run clippy (all features)
32+
run: cargo clippy --all --all-features -- -D warnings
33+
34+
# Additonal clippy checks for riscv-rt
35+
clippy-riscv-rt:
36+
strategy:
37+
matrix:
38+
toolchain: [ stable, nightly ]
39+
runs-on: ubuntu-latest
40+
continue-on-error: ${{ matrix.experimental || false }}
41+
steps:
42+
- uses: actions/checkout@v4
43+
- uses: dtolnay/rust-toolchain@master
44+
with:
45+
toolchain: ${{ matrix.toolchain }}
46+
components: clippy
47+
- name: Run clippy (s-mode)
48+
run: cargo clippy --package riscv-rt --all --features=s-mode -- -D warnings
49+
- name: Run clippy (single-hart)
50+
run: cargo clippy --package riscv-rt --all --features=single-hart -- -D warnings
3451

3552
# Job to check that all the lint checks succeeded
3653
clippy-check:
3754
needs:
3855
- clippy
56+
- clippy-riscv-rt
3957
runs-on: ubuntu-latest
4058
if: always()
4159
steps:

riscv-rt/.github/workflows/build.yaml renamed to .github/workflows/riscv-rt.yaml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ on:
44
pull_request:
55
merge_group:
66

7-
name: Build check
7+
name: Build check (riscv-rt)
88

99
jobs:
10-
build-riscv:
10+
build:
1111
strategy:
1212
matrix:
1313
# All generated code should be running on stable now, MRSV is 1.59.0
@@ -21,28 +21,31 @@ jobs:
2121
example:
2222
- empty
2323
- multi_core
24-
cargo_flags: [ "--no-default-features", "--all-features" ]
2524
include:
2625
# Nightly is only for reference and allowed to fail
2726
- toolchain: nightly
2827
experimental: true
2928
runs-on: ubuntu-latest
3029
continue-on-error: ${{ matrix.experimental || false }}
3130
steps:
32-
- uses: actions/checkout@v3
31+
- uses: actions/checkout@v4
3332
- uses: dtolnay/rust-toolchain@master
3433
with:
3534
toolchain: ${{ matrix.toolchain }}
3635
targets: ${{ matrix.target }}
37-
- name: Build library
38-
run: cargo build --target ${{ matrix.target }} ${{ matrix.cargo_flags }}
39-
- name: Build example
40-
run: RUSTFLAGS="-C link-arg=-Texamples/device.x" cargo build --target ${{ matrix.target }} --example ${{ matrix.example }} ${{ matrix.cargo_flags }}
36+
- name: Build (no features)
37+
run: RUSTFLAGS="-C link-arg=-Triscv-rt/examples/device.x" cargo build --package riscv-rt --target ${{ matrix.target }} --example ${{ matrix.example }}
38+
- name : Build example (s-mode)
39+
run: RUSTFLAGS="-C link-arg=-Triscv-rt/examples/device.x" cargo build --package riscv-rt --target ${{ matrix.target }} --example ${{ matrix.example }} --features=s-mode
40+
- name : Build example (single-hart)
41+
run: RUSTFLAGS="-C link-arg=-Triscv-rt/examples/device.x" cargo build --package riscv-rt --target ${{ matrix.target }} --example ${{ matrix.example }} --features=single-hart
42+
- name: Build example (all features)
43+
run: RUSTFLAGS="-C link-arg=-Triscv-rt/examples/device.x" cargo build --package riscv-rt --target ${{ matrix.target }} --example ${{ matrix.example }} --all-features
4144

4245
# Job to check that all the builds succeeded
4346
build-check:
4447
needs:
45-
- build-riscv
48+
- build
4649
runs-on: ubuntu-latest
4750
if: always()
4851
steps:

.github/workflows/build.yaml renamed to .github/workflows/riscv.yaml

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
on:
22
push:
3-
branches: [ master, add-riscv-rt ]
3+
branches: [ master ]
44
pull_request:
55
merge_group:
66

7-
name: Build check
7+
name: Build check (riscv)
88

99
jobs:
1010
# We check that the crate builds and links for all the toolchains and targets.
@@ -13,52 +13,42 @@ jobs:
1313
matrix:
1414
# All generated code should be running on stable now, MRSV is 1.59.0
1515
toolchain: [ stable, nightly, 1.60.0 ]
16-
package:
17-
- riscv
18-
- riscv-rt
1916
target:
2017
- riscv32i-unknown-none-elf
2118
- riscv32imc-unknown-none-elf
2219
- riscv32imac-unknown-none-elf
2320
- riscv64imac-unknown-none-elf
2421
- riscv64gc-unknown-none-elf
25-
cargo_flags: [ "--no-default-features", "--all-features" ]
2622
include:
2723
# Nightly is only for reference and allowed to fail
2824
- toolchain: nightly
2925
experimental: true
30-
- package: riscv-rt
31-
cargo_flags:
32-
- "--features=s-mode"
33-
- "--features=single-hart"
3426
runs-on: ubuntu-latest
3527
continue-on-error: ${{ matrix.experimental || false }}
3628
steps:
37-
- uses: actions/checkout@v3
29+
- uses: actions/checkout@v4
3830
- uses: dtolnay/rust-toolchain@master
3931
with:
4032
toolchain: ${{ matrix.toolchain }}
4133
targets: ${{ matrix.target }}
42-
- name: Build library
43-
run: cargo build --package ${{ matrix.package }} --target ${{ matrix.target }} ${{ matrix.cargo_flags }}
34+
- name: Build (no features)
35+
run: cargo build --package riscv --target ${{ matrix.target }}
36+
- name: Build (all features)
37+
run: cargo build --package riscv --target ${{ matrix.target }} --all-features
4438

4539
# On MacOS, Ubuntu, and Windows, we at least make sure that the crate builds and links.
4640
build-others:
4741
strategy:
4842
matrix:
49-
os:
50-
- macos-latest
51-
- ubuntu-latest
52-
- windows-latest
53-
package:
54-
- riscv
55-
cargo_flags: [ "--no-default-features", "--all-features" ]
43+
os: [ macos-latest, ubuntu-latest, windows-latest ]
5644
runs-on: ${{ matrix.os }}
5745
steps:
5846
- uses: actions/checkout@v3
5947
- uses: dtolnay/rust-toolchain@stable
60-
- name: Build crate for host OS
61-
run: cargo build --package ${{ matrix.package }} ${{ matrix.cargo_flags }}
48+
- name: Build (no features)
49+
run: cargo build --package riscv
50+
- name: Build (all features)
51+
run: cargo build --package riscv --all-features
6252

6353
# Job to check that all the builds succeeded
6454
build-check:

.github/workflows/rustfmt.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
on:
22
push:
3-
branches: [ master, add-riscv-rt ]
3+
branches: [ master ]
44
pull_request:
55
merge_group:
66

@@ -10,7 +10,7 @@ jobs:
1010
rustfmt:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v3
13+
- uses: actions/checkout@v4
1414
- uses: dtolnay/rust-toolchain@stable
1515
with:
1616
components: rustfmt

0 commit comments

Comments
 (0)