Skip to content

Commit

Permalink
adapt to Cargo workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
romancardenas committed Oct 7, 2024
1 parent 2a9542f commit e00b007
Show file tree
Hide file tree
Showing 25 changed files with 107 additions and 176 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
- 'e310x/**'
e310x-hal:
- 'e310x-hal/**'
hifive1:
- 'hifive1/**'
- name: Check for CHANGELOG.md (e310x)
if: steps.changes.outputs['e310x'] == 'true'
Expand All @@ -37,4 +39,12 @@ jobs:
changeLogPath: ./e310x-hal/CHANGELOG.md
skipLabels: 'skip changelog'
missingUpdateErrorMessage: 'Please add a changelog entry in the e310x-hal/CHANGELOG.md file.'

- name: Check for CHANGELOG.md (hifive1)
if: steps.changes.outputs['hifive1'] == 'true'
uses: dangoslen/changelog-enforcer@v3
with:
changeLogPath: ./hifive1/CHANGELOG.md
skipLabels: 'skip changelog'
missingUpdateErrorMessage: 'Please add a changelog entry in the hifive1/CHANGELOG.md file.'

8 changes: 4 additions & 4 deletions .github/workflows/e310x-hal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
build-riscv:
strategy:
matrix:
# All generated code should be running on stable now, MRSV is 1.65.0
toolchain: [ stable, nightly, 1.65.0 ]
# All generated code should be running on stable now, MRSV is 1.72.0
toolchain: [ stable, nightly, 1.72.0 ]
include:
# Nightly is only for reference and allowed to fail
- toolchain: nightly
Expand All @@ -26,9 +26,9 @@ jobs:
- name: Install Rust target
run: rustup target install riscv32imc-unknown-none-elf
- name: Build (no features)
run: cargo build --package e310x-hal --target riscv32imc-unknown-none-elf
run: cargo build --package e310x-hal
- name: Build (all features)
run: cargo build --package e310x-hal --target riscv32imc-unknown-none-elf --all-features
run: cargo build --package e310x-hal --all-features

# On MacOS and Ubuntu, we at least make sure that the crate builds and links.
# On Windows, linking fails when the rt feature is enabled.
Expand Down
13 changes: 5 additions & 8 deletions .github/workflows/e310x.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@ jobs:
build-riscv:
strategy:
matrix:
# All generated code should be running on stable now, MRSV is 1.65.0
toolchain: [ stable, nightly, 1.65.0 ]
target:
- riscv32imc-unknown-none-elf
- riscv32imac-unknown-none-elf # TODO e310x is not a purely IMAC core
# All generated code should be running on stable now, MRSV is 1.72.0
toolchain: [ stable, nightly, 1.72.0 ]
include:
# Nightly is only for reference and allowed to fail
- toolchain: nightly
Expand All @@ -27,11 +24,11 @@ jobs:
- name: Update Rust toolchain
run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- name: Install Rust target
run: rustup target install ${{ matrix.target }}
run: rustup target install riscv32imc-unknown-none-elf
- name: Build (no features)
run: cargo build --package e310x --target ${{ matrix.target }}
run: cargo build --package e310x
- name: Build (all features)
run: cargo build --package e310x --target ${{ matrix.target }} --all-features
run: cargo build --package e310x --all-features

# On MacOS and Ubuntu, we at least make sure that the crate builds and links.
# On Windows, linking fails when the rt feature is enabled.
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/hifive1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
on:
push:
branches: [ master ]
pull_request:
merge_group:

name: Build check (hifive1)

jobs:
# We check that the crate builds and links for all the toolchains and targets.
build-riscv:
strategy:
matrix:
# All generated code should be running on stable now, MRSV is 1.72.0
toolchain: [nightly, stable, 1.72.0]
board: [hifive1, hifive1-revb, redv, lofive, lofive-r1]
include:
# Nightly is only for reference and allowed to fail
- toolchain: nightly
experimental: true
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental || false }}
steps:
- uses: actions/checkout@v4
- name: Update Rust toolchain
run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- name: Install Rust target
run: rustup target install riscv32imc-unknown-none-elf
- name: Build (direct)
run: cargo build --package hifive1 --features board-${{ matrix.board }}
- name: Build (vectored)
run: cargo build --package hifive1 --features board-${{ matrix.board }},virq

# On MacOS and Ubuntu, we at least make sure that the crate builds and links.
# On Windows, linking fails when the rt feature is enabled.
build-others:
strategy:
matrix:
os: [ macos-latest, ubuntu-latest ]
board: [hifive1, hifive1-revb, redv, lofive, lofive-r1]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Update Rust toolchain
run: rustup update stable && rustup default stable
- name: Rename .cargo/config to .cargo/config.bak to ignore it
run: mv .cargo/config.toml .cargo/config.bak
- name: Build (direct)
run: cargo test --package hifive1 --features board-${{ matrix.board }}
- name: Build (vectored)
run: cargo test --package hifive1 --features board-${{ matrix.board }},virq

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ resolver = "2"
members = [
"e310x",
"e310x-hal",
"hifive1",
]
2 changes: 1 addition & 1 deletion e310x-hal/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Use `portable-atomic` with `zaamo` feature to use native `amo*` operations.
- Official target is now `riscv32imc-unknown-none-elf`, as it does not fully support the A extension.
- Update `e310x` dependency and adapt code
- Bump MSRV to 1.65.0 (check Cargo.toml)
- Bump MSRV to 1.72.0 to ensure a correct behavior of portable-atomic

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

Expand Down
2 changes: 1 addition & 1 deletion e310x-hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description = "HAL for the E310x family of microcontrollers."
keywords = ["riscv", "e310", "hal"]
license = "ISC"
edition = "2021"
rust-version = "1.65"
rust-version = "1.72"

[dependencies]
embedded-hal = { version = "0.2.6", features = ["unproven"] }
Expand Down
2 changes: 1 addition & 1 deletion e310x-hal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This project is developed and maintained by the [RISC-V team][team].

## Minimum Supported Rust Version (MSRV)

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

## License
Expand Down
2 changes: 1 addition & 1 deletion e310x/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]

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

## [v0.11.0]
Expand Down
2 changes: 1 addition & 1 deletion e310x/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ categories = ["embedded", "hardware-support", "no-std"]
description = "With svd2rust generated peripherals for Freedom E310 MCU's."
keywords = ["riscv", "register", "peripheral"]
license = "ISC"
rust-version = "1.65"
rust-version = "1.72"
edition = "2021"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion e310x/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This project is developed and maintained by the [RISC-V team][team].

## Minimum Supported Rust Version (MSRV)

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

## Requirements
Expand Down
1 change: 0 additions & 1 deletion hifive1/.github/CODEOWNERS

This file was deleted.

10 changes: 0 additions & 10 deletions hifive1/.github/bors.toml

This file was deleted.

61 changes: 0 additions & 61 deletions hifive1/.github/workflows/ci.yaml

This file was deleted.

24 changes: 0 additions & 24 deletions hifive1/.github/workflows/rustfmt.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions hifive1/.gitignore

This file was deleted.

2 changes: 2 additions & 0 deletions hifive1/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]
- Bump MSRV to 1.72
- Adapt to new Cargo workspace
- Use inline assembly instead of binary blobs for flash

## [v0.12.0] - 2023-03-28
Expand Down
37 changes: 0 additions & 37 deletions hifive1/CODE_OF_CONDUCT.md

This file was deleted.

9 changes: 5 additions & 4 deletions hifive1/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[package]
name = "hifive1"
version = "0.12.0"
version = "0.13.0"
repository = "https://github.com/riscv-rust/hifive1"
authors = ["David Craven <[email protected]>"]
categories = ["embedded", "hardware-support", "no-std"]
description = "Board support crate for HiFive1 and LoFive boards"
keywords = ["riscv", "register", "peripheral"]
license = "ISC"
edition = "2018"
rust-version = "1.59"
edition = "2021"
rust-version = "1.72"

[dependencies]
e310x-hal = "0.11.0"
e310x-hal = { path = "../e310x-hal", version = "0.11.0" }
embedded-hal = "0.2.7"
riscv = "0.10.1"
nb = "1.0.0"
Expand All @@ -22,6 +22,7 @@ board-hifive1-revb = ["e310x-hal/g002"]
board-redv = ["e310x-hal/g002"]
board-lofive = []
board-lofive-r1 = ["e310x-hal/g002"]
virq = ["e310x-hal/virq"]

[package.metadata.docs.rs]
features = ['board-hifive1-revb']
2 changes: 1 addition & 1 deletion hifive1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

## Minimum Supported Rust Version (MSRV)

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

## License
Expand Down
Loading

0 comments on commit e00b007

Please sign in to comment.