Skip to content

Commit 48ed325

Browse files
committed
prepare for Cargo Workspace
1 parent 743393a commit 48ed325

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+168
-134
lines changed

.github/bors.toml

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

.github/workflows/changelog.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Changelog check
2+
3+
on:
4+
merge_group:
5+
pull_request:
6+
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]
7+
8+
jobs:
9+
changelog-check:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: Check which component is modified
16+
uses: dorny/paths-filter@v2
17+
id: changes
18+
with:
19+
filters: |
20+
e310x:
21+
- 'e310x/**'
22+
23+
- name: Check for CHANGELOG.md (e310x)
24+
if: steps.changes.outputs['e310x'] == 'true'
25+
uses: dangoslen/changelog-enforcer@v3
26+
with:
27+
changeLogPath: ./e310x/CHANGELOG.md
28+
skipLabels: 'skip changelog'
29+
missingUpdateErrorMessage: 'Please add a changelog entry in the e310x/CHANGELOG.md file.'

.github/workflows/ci.yaml

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

.github/workflows/e310x.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
on:
2+
push:
3+
branches: [ master ]
4+
pull_request:
5+
merge_group:
6+
7+
name: Build check (e310x)
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.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
19+
include:
20+
# Nightly is only for reference and allowed to fail
21+
- toolchain: nightly
22+
experimental: true
23+
runs-on: ubuntu-latest
24+
continue-on-error: ${{ matrix.experimental || false }}
25+
steps:
26+
- uses: actions/checkout@v4
27+
- name: Update Rust toolchain
28+
run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
29+
- name: Install Rust target
30+
run: rustup target install ${{ matrix.target }}
31+
- name: Build (no features)
32+
run: cargo build --package e310x --target ${{ matrix.target }}
33+
- name: Build (all features)
34+
run: cargo build --package e310x --target ${{ matrix.target }} --all-features
35+
36+
# On MacOS and Ubuntu, we at least make sure that the crate builds and links.
37+
# On Windows, linking fails when the rt feature is enabled.
38+
build-others:
39+
strategy:
40+
matrix:
41+
os: [ macos-latest, ubuntu-latest ]
42+
runs-on: ${{ matrix.os }}
43+
steps:
44+
- uses: actions/checkout@v4
45+
- name: Update Rust toolchain
46+
run: rustup update stable && rustup default stable
47+
- name: Build (no features)
48+
run: cargo test --package e310x
49+
- name: Build (all features)
50+
run: cargo test --package e310x --all-features
51+

.github/workflows/rustfmt.yaml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,18 @@
1-
21
on:
32
push:
4-
branches: [ staging, trying, master ]
3+
branches: [ master ]
54
pull_request:
5+
merge_group:
66

77
name: Code formatting check
88

99
jobs:
1010
fmt:
1111
name: Rustfmt
12-
runs-on: ubuntu-20.04
12+
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v2
15-
- uses: actions-rs/toolchain@v1
16-
with:
17-
profile: minimal
18-
toolchain: stable
19-
override: true
20-
components: rustfmt
21-
- uses: actions-rs/cargo@v1
22-
with:
23-
command: fmt
24-
args: --all -- --check
14+
- uses: actions/checkout@v4
15+
- name: Update Rust toolchain
16+
run: rustup update stable && rustup default stable
17+
- name: Check code formatting
18+
run: cargo fmt --all -- --check --verbose

Cargo.toml

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,5 @@
1-
[package]
2-
name = "e310x"
3-
version = "0.11.0"
4-
repository = "https://github.com/riscv-rust/e310x"
5-
authors = ["David Craven <david@craven.ch>", "The RISC-V Team <risc-v@teams.rust-embedded.org>"]
6-
categories = ["embedded", "hardware-support", "no-std"]
7-
description = "With svd2rust generated peripherals for Freedom E310 MCU's."
8-
keywords = ["riscv", "register", "peripheral"]
9-
license = "ISC"
10-
rust-version = "1.59"
11-
edition = "2021"
12-
13-
[dependencies]
14-
critical-section = { version = "1.1.3", optional = true }
15-
vcell = "0.1.3"
16-
17-
[features]
18-
rt = []
19-
g002 = []
20-
21-
[package.metadata.docs.rs]
22-
features = ["rt", "g002", "critical-section"]
1+
[workspace]
2+
resolver = "2"
3+
members = [
4+
"e310x",
5+
]

README.md

Lines changed: 9 additions & 31 deletions

e310x/Cargo.toml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[package]
2+
name = "e310x"
3+
version = "0.11.0"
4+
repository = "https://github.com/riscv-rust/e310x"
5+
authors = ["David Craven <david@craven.ch>", "The RISC-V Team <risc-v@teams.rust-embedded.org>"]
6+
categories = ["embedded", "hardware-support", "no-std"]
7+
description = "With svd2rust generated peripherals for Freedom E310 MCU's."
8+
keywords = ["riscv", "register", "peripheral"]
9+
license = "ISC"
10+
rust-version = "1.59"
11+
edition = "2021"
12+
13+
[dependencies]
14+
critical-section = { version = "1.1.3", optional = true }
15+
vcell = "0.1.3"
16+
17+
[features]
18+
rt = []
19+
g002 = []
20+
21+
[package.metadata.docs.rs]
22+
features = ["rt", "g002", "critical-section"]

e310x/README.md

Lines changed: 44 additions & 0 deletions

0 commit comments

Comments
 (0)