Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fixes #62] Remove re-exports to avoid warnings promoted to errors #64

Merged
merged 7 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ env:

jobs:
setup:
if: github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
steps:
- name: Checkout sources
Expand All @@ -24,6 +25,7 @@ jobs:
feature_matrix: ${{ steps.features.outputs.feature_matrix }}

build:
if: github.event.pull_request.head.repo.full_name != github.repository
needs: setup
runs-on: ubuntu-latest
strategy:
Expand All @@ -39,7 +41,28 @@ jobs:
- name: Build HAL for ${{ matrix.pac }}
run: cargo check --package atsamx7x-hal --features ${{ matrix.pac }},unproven

build-latest:
if: github.event.pull_request.head.repo.full_name != github.repository
needs: setup
runs-on: ubuntu-latest
strategy:
matrix:
pac: ${{ fromJson(needs.setup.outputs.pac_matrix) }}
continue-on-error: true # we let this fail and carry on, but GH UI is poor not showing amber like other CIs
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Update toolchain
run: rustup update
- name: Specify toolchain
run: rustup override set stable
- name: Install Rust (thumbv7em)
run: rustup target add thumbv7em-none-eabihf
- name: Build HAL for ${{ matrix.pac }}
run: cargo check --package atsamx7x-hal --features ${{ matrix.pac }},unproven
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC, not using a board feature (like samv71q21b) omits the build of some modules.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tmplt ${{ matrix.pac }} is built from following output:

["same70j19b","same70j20b","same70j21b","same70n19b","same70n20b","same70n21b","same70q19b","same70q20b","same70q21b","sams70j19b","sams70j20b","sams70j21b","sams70n19b","sams70n20b","sams70n21b","sams70q19b","sams70q20b","sams70q21b","samv70j19b","samv70j20b","samv70n19b","samv70n20b","samv70q19b","samv70q20b","samv71j19b","samv71j20b","samv71j21b","samv71n19b","samv71n20b","samv71n21b","samv71q19b","samv71q20b","samv71q21b"]

and that's CI coming from you or your company.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, although it feels like the CI is slowly growing more and more unruly and there should be a better way to do this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitHub Action from Software Engineering perspective are utter nightmare. It's effectively a toy for JavaScript kids to develop their creativity, to serious tool for serious projects.


build-features:
if: github.event.pull_request.head.repo.full_name != github.repository
needs: setup
runs-on: ubuntu-latest
strategy:
Expand All @@ -56,6 +79,7 @@ jobs:
run: cargo check --package atsamx7x-hal --features ${{ matrix.features }},samv71q21b,unproven

board-examples:
if: github.event.pull_request.head.repo.full_name != github.repository
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michalfita What is the purpose of this line?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To stop redundant builds. We have two triggers push and pull_request: the former means we build everything we push including in PRs, the latter means changes in the PR are build, including branches in forks (outside contributors). But having both stupidly doubles each job. This condition let jobs from pull_request trigger on forks to be run, but stops on our own branches. Unfortunately, this condition cannot exists at higher level, has to be per job 🤦🏼‍♂️.

needs: setup
runs-on: ubuntu-latest
strategy:
Expand All @@ -74,6 +98,7 @@ jobs:
cargo check --examples

clippy-hal:
if: github.event.pull_request.head.repo.full_name != github.repository
needs: build
runs-on: ubuntu-latest
steps:
Expand All @@ -89,6 +114,7 @@ jobs:
run: cargo clippy --package atsamx7x-hal --no-deps --features samv71q21b,unproven,reconfigurable-system-pins -- --deny warnings

clippy-examples:
if: github.event.pull_request.head.repo.full_name != github.repository
needs: [setup, build, board-examples]
runs-on: ubuntu-latest
strategy:
Expand All @@ -109,6 +135,7 @@ jobs:
cargo clippy --examples --no-deps -- --deny warnings

docs:
if: github.event.pull_request.head.repo.full_name != github.repository
needs: build
runs-on: ubuntu-latest
steps:
Expand Down
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

### Added

- [Integration](https://crates.io/crates/mcan-core) with the
[`mcan`](https://crates.io/crates/mcan) crate.
- [Integration](https://crates.io/crates/mcan-core) with the [`mcan`](https://crates.io/crates/mcan) crate.
michalfita marked this conversation as resolved.
Show resolved Hide resolved
- Implementation of blocking::i2c::Transactional trait from [embedded-hal](https://crates.io/crates/embedded-hal) for TWI device.

### Changed
Expand All @@ -14,6 +13,7 @@
### Removed

### Fixed
- [#62] Remove ambiguous reexports from `src/serial/mod.rs`.
- TWIHS: Fix issue with clock frequency calculation.

## [v0.4.2] 2022-11-06
Expand Down
4 changes: 0 additions & 4 deletions hal/src/serial/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,11 @@ impl ExtBpsU32 for u32 {
}

pub mod uart;
pub use uart::*;

pub mod usart;
pub use usart::*;

pub mod twi;
pub use twi::*;

#[cfg(not(feature = "pins-64"))]
pub mod spi;
#[cfg(not(feature = "pins-64"))]
pub use spi::*;
2 changes: 1 addition & 1 deletion hal/src/serial/usart/uart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::ehal::{self, blocking};
pub enum UartError {
/// A frame's stop bit was read as zero.
Framing,
/// Parity check of the recived frame failed.
/// Parity check of the received frame failed.
Parity,
/// A word was received before the previous word was read.
Overrun,
Expand Down