-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(CI): Add unused dependencies check (#1741)
* chore(CI): Add unused dependencies check * comment * use flags matrix * Add a comment to force workflow run * fix duplicate flags and add to external * remove unused dependencies * Remove more unused dependencies * More ignores * do external udeps * lock file * fix doc tests * fix mysten-common * revert doc * a few more unused deps * external * merge methods * review --------- Co-authored-by: Thibault Martinez <[email protected]>
- Loading branch information
1 parent
cb0f591
commit 5659d99
Showing
43 changed files
with
345 additions
and
288 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
name: Rust tests | ||
|
||
on: workflow_call | ||
on: | ||
workflow_call: | ||
inputs: | ||
isRust: | ||
type: boolean | ||
|
||
jobs: | ||
changes: | ||
if: inputs.isRust | ||
runs-on: [self-hosted] | ||
outputs: | ||
components: ${{ steps.filter.outputs.changes }} | ||
|
@@ -18,7 +23,7 @@ jobs: | |
test: | ||
name: Test ${{ matrix.components }} | ||
needs: changes | ||
if: needs.changes.outputs.components != '[]' | ||
if: always() && inputs.isRust && needs.changes.outputs.components != '[]' | ||
env: | ||
# Tests written with #[sim_test] are often flaky if run as #[tokio::test] - this var | ||
# causes #[sim_test] to only run under the deterministic `simtest` job, and not the | ||
|
@@ -36,6 +41,7 @@ jobs: | |
run: cargo nextest run --profile ci -E 'rdeps(${{matrix.components}})' -p ${{matrix.components}} | ||
|
||
iota-sdk-changes: | ||
if: inputs.isRust | ||
runs-on: [self-hosted] | ||
outputs: | ||
changed: ${{ steps.filter.outputs.iota-sdk }} | ||
|
@@ -50,7 +56,7 @@ jobs: | |
test-iota-sdk: | ||
name: Test iota-sdk | ||
if: needs.iota-sdk-changes.outputs.changed == 'true' | ||
if: always() && inputs.isRust && needs.iota-sdk-changes.outputs.changed == 'true' | ||
env: | ||
# Tests written with #[sim_test] are often flaky if run as #[tokio::test] - this var | ||
# causes #[sim_test] to only run under the deterministic `simtest` job, and not the | ||
|
@@ -67,6 +73,39 @@ jobs: | |
# (we have the stardust iota-sdk package as a dependency) | ||
run: cargo nextest run --profile ci -E 'rdeps(iota-sdk)' -p [email protected] | ||
|
||
check-unused-deps: | ||
name: Check Unused Dependencies of ${{ matrix.components }} (${{ matrix.flags }}) | ||
if: always() && inputs.isRust && needs.changes.outputs.components != '[]' | ||
strategy: | ||
matrix: | ||
components: ${{ fromJson(needs.changes.outputs.components) }} | ||
flags: ["--all-features", "--no-default-features"] | ||
fail-fast: false | ||
runs-on: [self-hosted] | ||
needs: changes | ||
|
||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1 | ||
- name: Run Cargo Udeps | ||
run: cargo +nightly ci-udeps -p ${{matrix.components}} ${{ matrix.flags }} | ||
|
||
check-unused-deps-iota-sdk: | ||
name: Check Unused Dependencies of iota-sdk (${{ matrix.flags }}) | ||
if: always() && inputs.isRust && needs.iota-sdk-changes.outputs.changed == 'true' | ||
runs-on: [self-hosted] | ||
needs: iota-sdk-changes | ||
strategy: | ||
matrix: | ||
flags: ["--all-features", "--no-default-features"] | ||
|
||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1 | ||
# iota-sdk version needs to be explicitly defined here due to this bug | ||
# https://github.com/rust-lang/cargo/issues/12891 | ||
# (we have the stardust iota-sdk package as a dependency) | ||
- name: Run Cargo Udeps | ||
run: cargo +nightly ci-udeps -p [email protected] ${{ matrix.flags }} | ||
|
||
test-extra: | ||
env: | ||
# Tests written with #[sim_test] are often flaky if run as #[tokio::test] - this var | ||
|
Oops, something went wrong.