-
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): Always compile the entire workspace for CI tests (#2028)
* chore(CI): Always compile the entire workspace for CI tests * remove changes from udeps * Remove check for empty changes * Try fromJson * remove accidental command * echo * temp * quotes for echo * try building and eval * try quotes * fix exprs * Update mysticeti workflow too * temp2 * Revert "temp" This reverts commit 372e552. * Revert "temp2" This reverts commit 5b3933e. --------- Co-authored-by: Thibault Martinez <[email protected]>
- Loading branch information
1 parent
288cb5b
commit 380cc10
Showing
4 changed files
with
76 additions
and
85 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 |
---|---|---|
|
@@ -25,90 +25,53 @@ jobs: | |
filters: .github/crates-filters.yml | ||
|
||
test: | ||
name: Test ${{ matrix.components }} | ||
name: Test rust crates | ||
needs: changes | ||
if: always() && inputs.isRust && needs.changes.outputs.components != '[]' | ||
if: always() && inputs.isRust | ||
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 | ||
# non-deterministic `test` job. | ||
IOTA_SKIP_SIMTESTS: 1 | ||
strategy: | ||
matrix: | ||
components: ${{ fromJson(needs.changes.outputs.components) }} | ||
fail-fast: false | ||
runs-on: [self-hosted] | ||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | ||
- uses: taiki-e/install-action@nextest | ||
- name: cargo test | ||
run: cargo nextest run --profile ci -E 'rdeps(${{matrix.components}})' -p ${{matrix.components}} | ||
run: | | ||
array=(${{ join(fromJson(needs.changes.outputs.components), ' ') }}) | ||
iota-sdk-changes: | ||
if: inputs.isRust | ||
runs-on: [self-hosted] | ||
outputs: | ||
changed: ${{ steps.filter.outputs.iota-sdk }} | ||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | ||
- uses: dorny/paths-filter@v3 | ||
id: filter | ||
with: | ||
filters: | | ||
iota-sdk: | ||
- "crates/iota-sdk/**" | ||
result="" | ||
test-iota-sdk: | ||
name: Test iota-sdk | ||
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 | ||
# non-deterministic `test` job. | ||
IOTA_SKIP_SIMTESTS: 1 | ||
runs-on: [self-hosted] | ||
needs: iota-sdk-changes | ||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | ||
- uses: taiki-e/install-action@nextest | ||
- name: cargo test | ||
# 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) | ||
run: cargo nextest run --profile ci -E 'rdeps(iota-sdk)' -p [email protected] | ||
for item in "${array[@]}"; do | ||
mapped_item="-E 'rdeps(${item})'" | ||
if [ -z "$result" ]; then | ||
result="$mapped_item" | ||
else | ||
result="$result $mapped_item" | ||
fi | ||
done | ||
command="cargo nextest run --profile ci $result" | ||
echo "$command" | ||
eval ${command} | ||
check-unused-deps: | ||
name: Check Unused Dependencies of ${{ matrix.components }} (${{ matrix.flags }}) | ||
if: always() && inputs.isRust && needs.changes.outputs.components != '[]' | ||
name: Check Unused Dependencies (${{ matrix.flags }}) | ||
if: always() && inputs.isRust | ||
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 }} | ||
run: cargo +nightly ci-udeps ${{ matrix.flags }} | ||
|
||
test-extra: | ||
env: | ||
|