From 95a1080a4615be5e33ad544d579c54e2addd1269 Mon Sep 17 00:00:00 2001 From: 9names <60134748+9names@users.noreply.github.com> Date: Tue, 4 May 2021 17:38:01 +1000 Subject: [PATCH 1/4] Move rustfmt to seperateworkflow --- .github/workflows/check.yml | 6 +----- .github/workflows/rustfmt.yml | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/rustfmt.yml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 3441ac5..bc86c13 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -12,15 +12,11 @@ jobs: target: thumbv6m-none-eabi override: true profile: minimal - components: rustfmt, clippy + components: clippy - uses: actions-rs/cargo@v1 with: command: check args: --workspace - - uses: actions-rs/cargo@v1 - with: - command: fmt - args: -- --check - uses: actions-rs/cargo@v1 with: command: clippy diff --git a/.github/workflows/rustfmt.yml b/.github/workflows/rustfmt.yml new file mode 100644 index 0000000..528bb71 --- /dev/null +++ b/.github/workflows/rustfmt.yml @@ -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 From 41c6db68114933202b4111348b133bf7f8130d57 Mon Sep 17 00:00:00 2001 From: 9names <60134748+9names@users.noreply.github.com> Date: Tue, 4 May 2021 17:41:33 +1000 Subject: [PATCH 2/4] Move clippy into seperate workflow --- .github/workflows/check.yml | 5 ----- .github/workflows/clippy.yml | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/clippy.yml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index bc86c13..748f82e 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -12,15 +12,10 @@ jobs: target: thumbv6m-none-eabi override: true profile: minimal - components: clippy - uses: actions-rs/cargo@v1 with: command: check args: --workspace - - uses: actions-rs/cargo@v1 - with: - command: clippy - args: -- -Dwarnings - uses: actions-rs/cargo@v1 with: command: test diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml new file mode 100644 index 0000000..4675ef7 --- /dev/null +++ b/.github/workflows/clippy.yml @@ -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 From 691f43c17baee0a2d45cc4861f66629996bd8a1f Mon Sep 17 00:00:00 2001 From: 9names <60134748+9names@users.noreply.github.com> Date: Tue, 4 May 2021 17:52:48 +1000 Subject: [PATCH 3/4] Move tests into seperate workflow --- .github/workflows/check.yml | 6 +----- .github/workflows/tests_host.yml | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/tests_host.yml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 748f82e..c0f5358 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -2,7 +2,7 @@ on: [push, pull_request] name: CI Checks jobs: check: - name: Check and Lint + name: cargo-check runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 @@ -16,7 +16,3 @@ jobs: with: command: check args: --workspace - - uses: actions-rs/cargo@v1 - with: - command: test - args: --target x86_64-unknown-linux-gnu diff --git a/.github/workflows/tests_host.yml b/.github/workflows/tests_host.yml new file mode 100644 index 0000000..0d50f03 --- /dev/null +++ b/.github/workflows/tests_host.yml @@ -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 From 416baf64054ed038af804408ca03a8d861a4db9b Mon Sep 17 00:00:00 2001 From: 9names <60134748+9names@users.noreply.github.com> Date: Tue, 4 May 2021 18:08:06 +1000 Subject: [PATCH 4/4] Add #Safety tag to unsafe rationale docstring --- rp2040-hal/src/xosc.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rp2040-hal/src/xosc.rs b/rp2040-hal/src/xosc.rs index a499488..6f67b1e 100644 --- a/rp2040-hal/src/xosc.rs +++ b/rp2040-hal/src/xosc.rs @@ -175,6 +175,8 @@ impl CrystalOscillator { } /// Put the XOSC in DORMANT state. + /// + /// # Safety /// 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. /// This method does not do any of that, it merely switches the XOSC to DORMANT state.