Skip to content
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
66 changes: 45 additions & 21 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,25 +53,23 @@ jobs:

fmt:
runs-on: ubuntu-latest
name: nightly / fmt
name: stable / fmt
Comment thread
felipebalbi marked this conversation as resolved.
needs: commit_list
strategy:
fail-fast: false
matrix:
commit: ${{ fromJSON(needs.commit_list.outputs.commits) }}
workdir: [ "embedded-service", "cfu-service", "espi-service", "hid-service", "power-button-service", "storage-bus", "battery-service"]
steps:
- uses: actions/checkout@v4
with:
submodules: true
ref: ${{ matrix.commit }}
- name: Install nightly
uses: dtolnay/rust-toolchain@nightly
- name: Install stable
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: cargo fmt --check
run: cargo fmt --check
working-directory: ${{ matrix.workdir }}

clippy:
runs-on: ubuntu-latest
Expand All @@ -86,7 +84,6 @@ jobs:
# Get early warning of new lints which are regularly introduced in beta channels.
toolchain: [stable, beta]
commit: ${{ fromJSON(needs.commit_list.outputs.commits) }}
workdir: [ "embedded-service", "cfu-service", "espi-service", "hid-service", "power-button-service", "storage-bus", "battery-service"]
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -102,7 +99,6 @@ jobs:
with:
reporter: 'github-pr-check'
github_token: ${{ secrets.GITHUB_TOKEN }}
working-directory: ${{ matrix.workdir }}

# Enable once we have a released crate
# semver:
Expand Down Expand Up @@ -136,7 +132,6 @@ jobs:
fail-fast: false
matrix:
commit: ${{ fromJSON(needs.commit_list.outputs.commits) }}
workdir: [ "embedded-service", "cfu-service", "espi-service", "hid-service", "power-button-service", "storage-bus", "battery-service"]
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -150,7 +145,6 @@ jobs:
cargo doc --no-deps -F defmt
env:
RUSTDOCFLAGS: --cfg docsrs
working-directory: ${{ matrix.workdir }}

hack:
# cargo-hack checks combinations of feature flags to ensure that features are all additive
Expand All @@ -162,7 +156,6 @@ jobs:
fail-fast: false
matrix:
commit: ${{ fromJSON(needs.commit_list.outputs.commits) }}
workdir: [ "embedded-service", "cfu-service", "espi-service", "hid-service", "power-button-service", "storage-bus", "battery-service"]
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -176,7 +169,6 @@ jobs:
# --feature-powerset runs for every combination of features
- name: cargo hack
run: cargo hack --feature-powerset --mutually-exclusive-features=log,defmt check
working-directory: ${{ matrix.workdir }}

deny:
# cargo-deny checks licenses, advisories, sources, and bans for
Expand All @@ -188,7 +180,6 @@ jobs:
fail-fast: false
matrix:
commit: ${{ fromJSON(needs.commit_list.outputs.commits) }}
workdir: [ "embedded-service", "cfu-service", "espi-service", "hid-service", "power-button-service", "storage-bus", "battery-service"]
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -200,10 +191,27 @@ jobs:
uses: EmbarkStudios/cargo-deny-action@v2
with:
log-level: warn
manifest-path: ${{ matrix.workdir }}/Cargo.toml
command: check
arguments: --all-features

test:
runs-on: ubuntu-latest
name: ubuntu / stable / test
needs: commit_list
strategy:
fail-fast: false
matrix:
commit: ${{ fromJSON(needs.commit_list.outputs.commits) }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
ref: ${{ matrix.commit }}
- name: Install stable
uses: dtolnay/rust-toolchain@stable
- name: cargo test
run: cargo test

msrv:
# check that we can build using the minimal rust version that is specified by this crate
runs-on: ubuntu-latest
Expand All @@ -214,13 +222,7 @@ jobs:
fail-fast: false
matrix:
commit: ${{ fromJSON(needs.commit_list.outputs.commits) }}
workdir: [ "embedded-service", "cfu-service", "espi-service", "hid-service", "power-button-service", "storage-bus", "battery-service"]
msrv: ["1.83"] # We're relying on namespaced-features, which
# was released in 1.60
#
# We also depend on `fixed' which requires rust
# 1.79
# Embassy requires 1.83
msrv: ["1.85"]
name: ubuntu / ${{ matrix.msrv }}
steps:
- uses: actions/checkout@v4
Expand All @@ -235,4 +237,26 @@ jobs:
run: |
cargo check -F log
cargo check -F defmt
working-directory: ${{ matrix.workdir }}

check-examples:
runs-on: ubuntu-latest
needs: commit_list
# we use a matrix here just because env can't be used in job names
# https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability
strategy:
fail-fast: false
matrix:
commit: ${{ fromJSON(needs.commit_list.outputs.commits) }}
example_directory: ["examples/rt633"]
name: ubuntu / check-examples
steps:
- uses: actions/checkout@v4
with:
submodules: true
ref: ${{ matrix.commit }}
- name: Install stable
uses: dtolnay/rust-toolchain@stable
- name: cargo check
working-directory: ${{ matrix.example_directory }}
run: |
cargo check --target thumbv8m.main-none-eabihf
6 changes: 3 additions & 3 deletions .github/workflows/nostd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:
strategy:
matrix:
target: [thumbv8m.main-none-eabihf]
workdir: [ "embedded-service", "espi-service", "power-button-service", "storage-bus", "battery-service"]
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -27,6 +26,7 @@ jobs:
uses: dtolnay/rust-toolchain@stable
- name: rustup target add ${{ matrix.target }}
run: rustup target add ${{ matrix.target }}
- name: cargo install cargo-hack
uses: taiki-e/install-action@cargo-hack
- name: cargo check
run: cargo check --target ${{ matrix.target }} --no-default-features
working-directory: ${{ matrix.workdir }}
run: cargo hack --feature-powerset --mutually-exclusive-features=log,defmt check --target ${{ matrix.target }}
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
debug/
target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

Expand Down
18 changes: 5 additions & 13 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,10 @@
},
"rust-analyzer.check.allTargets": false,
"rust-analyzer.cargo.target": "thumbv8m.main-none-eabihf",
"rust-analyzer.cargo.features": [],
"rust-analyzer.linkedProjects": [
"${workspaceFolder}/embedded-service/Cargo.toml",
"${workspaceFolder}/espi-service/Cargo.toml",
"${workspaceFolder}/hid-service/Cargo.toml",
"${workspaceFolder}/power-button-service/Cargo.toml",
"${workspaceFolder}/power-policy-service/Cargo.toml",
"${workspaceFolder}/battery-service/Cargo.toml",
"${workspaceFolder}/examples/rt633/Cargo.toml",
"${workspaceFolder}/examples/rt685s-evk/Cargo.toml",
"${workspaceFolder}/examples/std/Cargo.toml",
"${workspaceFolder}/type-c-service/Cargo.toml",
],
"rust-analyzer.cargo.features": [
"examples/rt633/Cargo.toml",
"examples/rt685s-evk/Cargo.toml",
"examples/std/Cargo.toml"
]
}
}
Loading