Skip to content

Commit ee87aab

Browse files
authored
Merge pull request #817 from rust-embedded/regress-even-better
regress even better
2 parents 25c35b6 + 1b7e5e4 commit ee87aab

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

.github/workflows/diff.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,18 @@ on:
66
jobs:
77
generate:
88
name: |
9-
Generate matrix. ${{ github.event.comment.user.name }}: ${{ github.event.comment.author_association}}
9+
Generate matrix.
1010
runs-on: ubuntu-latest
1111
outputs:
1212
diffs: ${{ steps.regress-ci.outputs.diffs }}
13-
if: github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && (contains(toJson(github.event.comment.body), '\n/ci') || startsWith(github.event.comment.body, '/ci'))
13+
if: contains(toJson(github.event.comment.body), '\n/ci') || startsWith(github.event.comment.body, '/ci')
1414
steps:
15+
- name: Is member
16+
run: |
17+
if [[ "${{ github.event.comment.author_association }}" != "MEMBER" && "${{ github.event.comment.author_association }}" != "OWNER" ]]; then
18+
exit 1
19+
fi
20+
1521
- uses: actions/checkout@v4
1622

1723
- uses: dtolnay/rust-toolchain@master

ci/svd2rust-regress/src/diff.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ impl Diffing {
187187

188188
let test = match (tests.len(), self.sub.as_ref(), self.url.as_ref()) {
189189
(1, _, None) => tests[0].clone(),
190-
(_, Some(DiffingMode::Pr { .. }), None) => tests
190+
(_, Some(DiffingMode::Pr { .. } | DiffingMode::Semver { .. }), None) => tests
191191
.iter()
192192
.find(|t| t.chip == "STM32F103")
193193
.map(|t| (*t).clone())

ci/svd2rust-regress/src/svd_test.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,10 @@ impl TestCase {
191191
self.name(),
192192
chip_dir.display()
193193
);
194+
// XXX: Workaround for https://github.com/rust-lang/cargo/issues/6009#issuecomment-1925445245
195+
let manifest_path = crate::get_cargo_workspace().join("Cargo.toml");
196+
let workspace_toml =
197+
fs::read(&manifest_path).context("failed to read workspace Cargo.toml")?;
194198
Command::new("cargo")
195199
.env("USER", user)
196200
.arg("init")
@@ -201,6 +205,9 @@ impl TestCase {
201205
.arg(&chip_dir)
202206
.capture_outputs(true, "cargo init", None, None, &[])
203207
.with_context(|| "Failed to cargo init")?;
208+
std::fs::write(manifest_path, workspace_toml)
209+
.context("failed to write workspace Cargo.toml")?;
210+
204211
let svd_toml = path_helper_base(&chip_dir, &["Cargo.toml"]);
205212
let mut file = OpenOptions::new()
206213
.write(true)

0 commit comments

Comments
 (0)