Merge pull request #32 from 9names/ci_improvement

CI improvement: separate tasks, disable cargo test, fix clippy warning
This commit is contained in:
9names 2021-05-05 08:22:23 +10:00 committed by GitHub
commit e30d4af814
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 59 additions and 14 deletions

View file

@ -2,7 +2,7 @@ on: [push, pull_request]
name: CI Checks name: CI Checks
jobs: jobs:
check: check:
name: Check and Lint name: cargo-check
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@ -12,20 +12,7 @@ jobs:
target: thumbv6m-none-eabi target: thumbv6m-none-eabi
override: true override: true
profile: minimal profile: minimal
components: rustfmt, clippy
- uses: actions-rs/cargo@v1 - uses: actions-rs/cargo@v1
with: with:
command: check command: check
args: --workspace args: --workspace
- uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check
- uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -Dwarnings
- uses: actions-rs/cargo@v1
with:
command: test
args: --target x86_64-unknown-linux-gnu

18
.github/workflows/clippy.yml vendored Normal file
View file

@ -0,0 +1,18 @@
on: [push, pull_request]
name: Clippy check
jobs:
clippy_check:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: thumbv6m-none-eabi
override: true
profile: minimal
components: clippy
- uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -Dwarnings

19
.github/workflows/rustfmt.yml vendored Normal file
View file

@ -0,0 +1,19 @@
on: [push, pull_request]
name: Code formatting check
jobs:
fmt:
name: Rustfmt
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: thumbv6m-none-eabi
override: true
profile: minimal
components: rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check

19
.github/workflows/tests_host.yml vendored Normal file
View file

@ -0,0 +1,19 @@
on: [push, pull_request]
name: On-host tests
jobs:
check:
name: Check and Lint
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: thumbv6m-none-eabi
override: true
profile: minimal
## Tests are currently not working on host - disabled until we can find a good solution
# - uses: actions-rs/cargo@v1
# with:
# command: test
# args: --target x86_64-unknown-linux-gnu

View file

@ -175,6 +175,8 @@ impl CrystalOscillator<Stable> {
} }
/// Put the XOSC in DORMANT state. /// Put the XOSC in DORMANT state.
///
/// # Safety
/// This method is marked unsafe because prior to switch the XOSC into DORMANT state, /// This method is marked unsafe because prior to switch the XOSC into DORMANT state,
/// PLLs must be stopped and IRQs have to be properly configured. /// PLLs must be stopped and IRQs have to be properly configured.
/// This method does not do any of that, it merely switches the XOSC to DORMANT state. /// This method does not do any of that, it merely switches the XOSC to DORMANT state.