Skip to content

Commit a132e2f

Browse files
committed
Initialize cargo workspace in repo root, and update dependencies across multiple services. Add testing workflow to GitHub Actions for improved CI/CD. Clean up Cargo.toml files for unified depenencies across all crates.
1 parent 1646a81 commit a132e2f

File tree

27 files changed

+1496
-187
lines changed

27 files changed

+1496
-187
lines changed

.github/workflows/check.yml

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -53,25 +53,23 @@ jobs:
5353

5454
fmt:
5555
runs-on: ubuntu-latest
56-
name: nightly / fmt
56+
name: stable / fmt
5757
needs: commit_list
5858
strategy:
5959
fail-fast: false
6060
matrix:
6161
commit: ${{ fromJSON(needs.commit_list.outputs.commits) }}
62-
workdir: [ "embedded-service", "cfu-service", "espi-service", "hid-service", "power-button-service", "storage-bus", "battery-service"]
6362
steps:
6463
- uses: actions/checkout@v4
6564
with:
6665
submodules: true
6766
ref: ${{ matrix.commit }}
68-
- name: Install nightly
69-
uses: dtolnay/rust-toolchain@nightly
67+
- name: Install stable
68+
uses: dtolnay/rust-toolchain@stable
7069
with:
7170
components: rustfmt
7271
- name: cargo fmt --check
7372
run: cargo fmt --check
74-
working-directory: ${{ matrix.workdir }}
7573

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

107103
# Enable once we have a released crate
108104
# semver:
@@ -136,7 +132,6 @@ jobs:
136132
fail-fast: false
137133
matrix:
138134
commit: ${{ fromJSON(needs.commit_list.outputs.commits) }}
139-
workdir: [ "embedded-service", "cfu-service", "espi-service", "hid-service", "power-button-service", "storage-bus", "battery-service"]
140135
steps:
141136
- uses: actions/checkout@v4
142137
with:
@@ -150,7 +145,6 @@ jobs:
150145
cargo doc --no-deps -F defmt
151146
env:
152147
RUSTDOCFLAGS: --cfg docsrs
153-
working-directory: ${{ matrix.workdir }}
154148

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

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

197+
test:
198+
runs-on: ubuntu-latest
199+
name: ubuntu / stable / test
200+
needs: commit_list
201+
strategy:
202+
fail-fast: false
203+
matrix:
204+
commit: ${{ fromJSON(needs.commit_list.outputs.commits) }}
205+
steps:
206+
- uses: actions/checkout@v4
207+
with:
208+
submodules: true
209+
ref: ${{ matrix.commit }}
210+
- name: Install stable
211+
uses: dtolnay/rust-toolchain@stable
212+
- name: cargo test
213+
run: cargo test
214+
207215
msrv:
208216
# check that we can build using the minimal rust version that is specified by this crate
209217
runs-on: ubuntu-latest
@@ -214,13 +222,7 @@ jobs:
214222
fail-fast: false
215223
matrix:
216224
commit: ${{ fromJSON(needs.commit_list.outputs.commits) }}
217-
workdir: [ "embedded-service", "cfu-service", "espi-service", "hid-service", "power-button-service", "storage-bus", "battery-service"]
218-
msrv: ["1.83"] # We're relying on namespaced-features, which
219-
# was released in 1.60
220-
#
221-
# We also depend on `fixed' which requires rust
222-
# 1.79
223-
# Embassy requires 1.83
225+
msrv: ["1.85"]
224226
name: ubuntu / ${{ matrix.msrv }}
225227
steps:
226228
- uses: actions/checkout@v4
@@ -235,4 +237,3 @@ jobs:
235237
run: |
236238
cargo check -F log
237239
cargo check -F defmt
238-
working-directory: ${{ matrix.workdir }}

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
debug/
44
target/
55

6-
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
7-
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
8-
Cargo.lock
9-
106
# These are backup files generated by rustfmt
117
**/*.rs.bk
128

.vscode/settings.json

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,5 @@
1010
},
1111
"rust-analyzer.check.allTargets": false,
1212
"rust-analyzer.cargo.target": "thumbv8m.main-none-eabihf",
13-
"rust-analyzer.linkedProjects": [
14-
"${workspaceFolder}/embedded-service/Cargo.toml",
15-
"${workspaceFolder}/espi-service/Cargo.toml",
16-
"${workspaceFolder}/hid-service/Cargo.toml",
17-
"${workspaceFolder}/power-button-service/Cargo.toml",
18-
"${workspaceFolder}/power-policy-service/Cargo.toml",
19-
"${workspaceFolder}/battery-service/Cargo.toml",
20-
"${workspaceFolder}/examples/rt633/Cargo.toml",
21-
"${workspaceFolder}/examples/rt685s-evk/Cargo.toml",
22-
"${workspaceFolder}/examples/std/Cargo.toml",
23-
"${workspaceFolder}/type-c-service/Cargo.toml",
24-
],
25-
"rust-analyzer.cargo.features": [
26-
]
27-
}
13+
"rust-analyzer.cargo.features": []
14+
}

0 commit comments

Comments
 (0)