Skip to content

Commit

Permalink
Merge pull request #33 from riscv-rust/cargo-workspace
Browse files Browse the repository at this point in the history
prepare for Cargo Workspace
  • Loading branch information
almindor authored Sep 17, 2024
2 parents 743393a + 48ed325 commit 31244a5
Show file tree
Hide file tree
Showing 134 changed files with 168 additions and 134 deletions.
10 changes: 0 additions & 10 deletions .github/bors.toml

This file was deleted.

29 changes: 29 additions & 0 deletions .github/workflows/changelog.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Changelog check

on:
merge_group:
pull_request:
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]

jobs:
changelog-check:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Check which component is modified
uses: dorny/paths-filter@v2
id: changes
with:
filters: |
e310x:
- 'e310x/**'
- name: Check for CHANGELOG.md (e310x)
if: steps.changes.outputs['e310x'] == 'true'
uses: dangoslen/changelog-enforcer@v3
with:
changeLogPath: ./e310x/CHANGELOG.md
skipLabels: 'skip changelog'
missingUpdateErrorMessage: 'Please add a changelog entry in the e310x/CHANGELOG.md file.'
57 changes: 0 additions & 57 deletions .github/workflows/ci.yaml

This file was deleted.

51 changes: 51 additions & 0 deletions .github/workflows/e310x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
on:
push:
branches: [ master ]
pull_request:
merge_group:

name: Build check (e310x)

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.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
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 ${{ matrix.target }}
- name: Build (no features)
run: cargo build --package e310x --target ${{ matrix.target }}
- name: Build (all features)
run: cargo build --package e310x --target ${{ matrix.target }} --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.
build-others:
strategy:
matrix:
os: [ macos-latest, ubuntu-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Update Rust toolchain
run: rustup update stable && rustup default stable
- name: Build (no features)
run: cargo test --package e310x
- name: Build (all features)
run: cargo test --package e310x --all-features

22 changes: 8 additions & 14 deletions .github/workflows/rustfmt.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@

on:
push:
branches: [ staging, trying, master ]
branches: [ master ]
pull_request:
merge_group:

name: Code formatting check

jobs:
fmt:
name: Rustfmt
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- uses: actions/checkout@v4
- name: Update Rust toolchain
run: rustup update stable && rustup default stable
- name: Check code formatting
run: cargo fmt --all -- --check --verbose
27 changes: 5 additions & 22 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,5 @@
[package]
name = "e310x"
version = "0.11.0"
repository = "https://github.com/riscv-rust/e310x"
authors = ["David Craven <[email protected]>", "The RISC-V Team <[email protected]>"]
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.59"
edition = "2021"

[dependencies]
critical-section = { version = "1.1.3", optional = true }
vcell = "0.1.3"

[features]
rt = []
g002 = []

[package.metadata.docs.rs]
features = ["rt", "g002", "critical-section"]
[workspace]
resolver = "2"
members = [
"e310x",
]
40 changes: 9 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,23 @@
[![crates.io](https://img.shields.io/crates/d/e310x.svg)](https://crates.io/crates/e310x)
[![crates.io](https://img.shields.io/crates/v/e310x.svg)](https://crates.io/crates/e310x)
[![Build Status](https://travis-ci.org/riscv-rust/e310x.svg?branch=master)](https://travis-ci.org/riscv-rust/e310x)
# E301x crates

# `e310x`
This repository contains various crates useful for writing Rust programs on E310x microcontrollers:

> With svd2rust generated peripherals for Freedom E310 MCU's.
* [`e310x`]: Peripheral Access Crate (PAC) for E310x chips.

This project is developed and maintained by the [RISC-V team][team].

## [Documentation](https://docs.rs/crate/e310x)
### Contribution

## Minimum Supported Rust Version (MSRV)

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

## Requirements

Install [form](https://crates.io/crates/form) and [svd2rust](https://crates.io/crates/svd2rust) using cargo install

## License

Copyright 2018-2023 [RISC-V team][team]

Permission to use, copy, modify, and/or distribute this software for any purpose
with or without fee is hereby granted, provided that the above copyright notice
and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the
work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any
additional terms or conditions.

## Code of Conduct

Contribution to this crate is organized under the terms of the [Rust Code of
Conduct][CoC], the maintainer of this crate, the [RISC-V team][team], promises
to intervene to uphold that code of conduct.

[CoC]: CODE_OF_CONDUCT.md
[`riscv`]: https://crates.io/crates/e310x
[team]: https://github.com/rust-embedded/wg#the-risc-v-team
[CoC]: CODE_OF_CONDUCT.md
File renamed without changes.
22 changes: 22 additions & 0 deletions e310x/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[package]
name = "e310x"
version = "0.11.0"
repository = "https://github.com/riscv-rust/e310x"
authors = ["David Craven <[email protected]>", "The RISC-V Team <[email protected]>"]
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.59"
edition = "2021"

[dependencies]
critical-section = { version = "1.1.3", optional = true }
vcell = "0.1.3"

[features]
rt = []
g002 = []

[package.metadata.docs.rs]
features = ["rt", "g002", "critical-section"]
44 changes: 44 additions & 0 deletions e310x/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[![crates.io](https://img.shields.io/crates/d/e310x.svg)](https://crates.io/crates/e310x)
[![crates.io](https://img.shields.io/crates/v/e310x.svg)](https://crates.io/crates/e310x)

# `e310x`

> With svd2rust generated peripherals for Freedom E310 MCU's.
This project is developed and maintained by the [RISC-V team][team].

## [Documentation](https://docs.rs/crate/e310x)

## Minimum Supported Rust Version (MSRV)

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

## Requirements

Install [form](https://crates.io/crates/form) and [svd2rust](https://crates.io/crates/svd2rust) using cargo install

## License

Copyright 2018-2023 [RISC-V team][team]

Permission to use, copy, modify, and/or distribute this software for any purpose
with or without fee is hereby granted, provided that the above copyright notice
and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.

## Code of Conduct

Contribution to this crate is organized under the terms of the [Rust Code of
Conduct][CoC], the maintainer of this crate, the [RISC-V team][team], promises
to intervene to uphold that code of conduct.

[CoC]: CODE_OF_CONDUCT.md
[team]: https://github.com/rust-embedded/wg#the-risc-v-team
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 31244a5

Please sign in to comment.