Skip to content

Commit e00b007

Browse files
committed
adapt to Cargo workspace
1 parent 2a9542f commit e00b007

25 files changed

+107
-176
lines changed

.github/workflows/changelog.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ jobs:
2121
- 'e310x/**'
2222
e310x-hal:
2323
- 'e310x-hal/**'
24+
hifive1:
25+
- 'hifive1/**'
2426
2527
- name: Check for CHANGELOG.md (e310x)
2628
if: steps.changes.outputs['e310x'] == 'true'
@@ -37,4 +39,12 @@ jobs:
3739
changeLogPath: ./e310x-hal/CHANGELOG.md
3840
skipLabels: 'skip changelog'
3941
missingUpdateErrorMessage: 'Please add a changelog entry in the e310x-hal/CHANGELOG.md file.'
42+
43+
- name: Check for CHANGELOG.md (hifive1)
44+
if: steps.changes.outputs['hifive1'] == 'true'
45+
uses: dangoslen/changelog-enforcer@v3
46+
with:
47+
changeLogPath: ./hifive1/CHANGELOG.md
48+
skipLabels: 'skip changelog'
49+
missingUpdateErrorMessage: 'Please add a changelog entry in the hifive1/CHANGELOG.md file.'
4050

.github/workflows/e310x-hal.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ jobs:
1111
build-riscv:
1212
strategy:
1313
matrix:
14-
# All generated code should be running on stable now, MRSV is 1.65.0
15-
toolchain: [ stable, nightly, 1.65.0 ]
14+
# All generated code should be running on stable now, MRSV is 1.72.0
15+
toolchain: [ stable, nightly, 1.72.0 ]
1616
include:
1717
# Nightly is only for reference and allowed to fail
1818
- toolchain: nightly
@@ -26,9 +26,9 @@ jobs:
2626
- name: Install Rust target
2727
run: rustup target install riscv32imc-unknown-none-elf
2828
- name: Build (no features)
29-
run: cargo build --package e310x-hal --target riscv32imc-unknown-none-elf
29+
run: cargo build --package e310x-hal
3030
- name: Build (all features)
31-
run: cargo build --package e310x-hal --target riscv32imc-unknown-none-elf --all-features
31+
run: cargo build --package e310x-hal --all-features
3232

3333
# On MacOS and Ubuntu, we at least make sure that the crate builds and links.
3434
# On Windows, linking fails when the rt feature is enabled.

.github/workflows/e310x.yaml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@ jobs:
1111
build-riscv:
1212
strategy:
1313
matrix:
14-
# All generated code should be running on stable now, MRSV is 1.65.0
15-
toolchain: [ stable, nightly, 1.65.0 ]
16-
target:
17-
- riscv32imc-unknown-none-elf
18-
- riscv32imac-unknown-none-elf # TODO e310x is not a purely IMAC core
14+
# All generated code should be running on stable now, MRSV is 1.72.0
15+
toolchain: [ stable, nightly, 1.72.0 ]
1916
include:
2017
# Nightly is only for reference and allowed to fail
2118
- toolchain: nightly
@@ -27,11 +24,11 @@ jobs:
2724
- name: Update Rust toolchain
2825
run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
2926
- name: Install Rust target
30-
run: rustup target install ${{ matrix.target }}
27+
run: rustup target install riscv32imc-unknown-none-elf
3128
- name: Build (no features)
32-
run: cargo build --package e310x --target ${{ matrix.target }}
29+
run: cargo build --package e310x
3330
- name: Build (all features)
34-
run: cargo build --package e310x --target ${{ matrix.target }} --all-features
31+
run: cargo build --package e310x --all-features
3532

3633
# On MacOS and Ubuntu, we at least make sure that the crate builds and links.
3734
# On Windows, linking fails when the rt feature is enabled.

.github/workflows/hifive1.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
on:
2+
push:
3+
branches: [ master ]
4+
pull_request:
5+
merge_group:
6+
7+
name: Build check (hifive1)
8+
9+
jobs:
10+
# We check that the crate builds and links for all the toolchains and targets.
11+
build-riscv:
12+
strategy:
13+
matrix:
14+
# All generated code should be running on stable now, MRSV is 1.72.0
15+
toolchain: [nightly, stable, 1.72.0]
16+
board: [hifive1, hifive1-revb, redv, lofive, lofive-r1]
17+
include:
18+
# Nightly is only for reference and allowed to fail
19+
- toolchain: nightly
20+
experimental: true
21+
runs-on: ubuntu-latest
22+
continue-on-error: ${{ matrix.experimental || false }}
23+
steps:
24+
- uses: actions/checkout@v4
25+
- name: Update Rust toolchain
26+
run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
27+
- name: Install Rust target
28+
run: rustup target install riscv32imc-unknown-none-elf
29+
- name: Build (direct)
30+
run: cargo build --package hifive1 --features board-${{ matrix.board }}
31+
- name: Build (vectored)
32+
run: cargo build --package hifive1 --features board-${{ matrix.board }},virq
33+
34+
# On MacOS and Ubuntu, we at least make sure that the crate builds and links.
35+
# On Windows, linking fails when the rt feature is enabled.
36+
build-others:
37+
strategy:
38+
matrix:
39+
os: [ macos-latest, ubuntu-latest ]
40+
board: [hifive1, hifive1-revb, redv, lofive, lofive-r1]
41+
runs-on: ${{ matrix.os }}
42+
steps:
43+
- uses: actions/checkout@v4
44+
- name: Update Rust toolchain
45+
run: rustup update stable && rustup default stable
46+
- name: Rename .cargo/config to .cargo/config.bak to ignore it
47+
run: mv .cargo/config.toml .cargo/config.bak
48+
- name: Build (direct)
49+
run: cargo test --package hifive1 --features board-${{ matrix.board }}
50+
- name: Build (vectored)
51+
run: cargo test --package hifive1 --features board-${{ matrix.board }},virq
52+

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ resolver = "2"
33
members = [
44
"e310x",
55
"e310x-hal",
6+
"hifive1",
67
]

e310x-hal/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1111
- Use `portable-atomic` with `zaamo` feature to use native `amo*` operations.
1212
- Official target is now `riscv32imc-unknown-none-elf`, as it does not fully support the A extension.
1313
- Update `e310x` dependency and adapt code
14-
- Bump MSRV to 1.65.0 (check Cargo.toml)
14+
- Bump MSRV to 1.72.0 to ensure a correct behavior of portable-atomic
1515

1616
## [v0.10.0] - 2023-03-28
1717

e310x-hal/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description = "HAL for the E310x family of microcontrollers."
88
keywords = ["riscv", "e310", "hal"]
99
license = "ISC"
1010
edition = "2021"
11-
rust-version = "1.65"
11+
rust-version = "1.72"
1212

1313
[dependencies]
1414
embedded-hal = { version = "0.2.6", features = ["unproven"] }

e310x-hal/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This project is developed and maintained by the [RISC-V team][team].
1212

1313
## Minimum Supported Rust Version (MSRV)
1414

15-
This crate is guaranteed to compile on stable Rust 1.60.0 and up. It *might*
15+
This crate is guaranteed to compile on stable Rust 1.72.0 and up. It *might*
1616
compile with older versions but that may change in any new patch release.
1717

1818
## License

e310x/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
88
## [Unreleased]
99

1010
### Changed
11-
- Bump MSRV to 1.65.0 (check Cargo.toml)
11+
- Bump MSRV to 1.72.0 to ensure a correct behavior of portable-atomic
1212
- Regenerate code with `svd2rust` v0.33.4
1313

1414
## [v0.11.0]

e310x/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ categories = ["embedded", "hardware-support", "no-std"]
77
description = "With svd2rust generated peripherals for Freedom E310 MCU's."
88
keywords = ["riscv", "register", "peripheral"]
99
license = "ISC"
10-
rust-version = "1.65"
10+
rust-version = "1.72"
1111
edition = "2021"
1212

1313
[dependencies]

0 commit comments

Comments
 (0)