-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(CI): Refactor rust CI workflows into a hierarchy (#1616)
* chore(CI): Refactor rust CI workflows into a hierarchy * update name * update old paths-filter action * tweaks * remove rust cache from license check * update external too * add hierarchy top level workflow and gate other big workflows behind dprint * Add more to the hierarchy * parallelize more * more reworking * remove excess diff job * cleanup * more * move clippy back * move license check up * simplify call * Update .github/workflows/_e2e.yml Co-authored-by: Thoralf-M <[email protected]> * use diff for license check * add doc filter and update filters for workflows --------- Co-authored-by: Mario Sarcevic <[email protected]> Co-authored-by: Thibault Martinez <[email protected]> Co-authored-by: Thoralf-M <[email protected]>
- Loading branch information
1 parent
8007a24
commit 9bcaeb1
Showing
19 changed files
with
408 additions
and
450 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Docs spellcheck and linting | ||
|
||
on: workflow_call | ||
|
||
jobs: | ||
spelling: | ||
name: Lint documentation | ||
runs-on: [self-hosted] | ||
|
||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1 | ||
- name: Spell Check Docs | ||
uses: crate-ci/[email protected] | ||
with: | ||
files: ./docs/content |
10 changes: 1 addition & 9 deletions
10
.github/workflows/docusaurus.yml → .github/workflows/_docusaurus.yml
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Execution cut | ||
|
||
on: workflow_call | ||
|
||
jobs: | ||
execution-cut: | ||
name: cutting a new execution layer | ||
runs-on: [self-hosted] | ||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1 | ||
- name: Install cargo-hakari, and cache the binary | ||
uses: baptiste0928/cargo-install@1cd874a5478fdca35d868ccc74640c5aabbb8f1b # [email protected] | ||
with: | ||
crate: cargo-hakari | ||
locked: true | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1 | ||
- name: Make cut | ||
run: ./scripts/execution_layer.py cut for_ci_test | ||
- name: Check execution builds | ||
run: cargo build -p iota-execution |
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Rust lints | ||
|
||
on: workflow_call | ||
|
||
jobs: | ||
rustfmt: | ||
runs-on: [self-hosted] | ||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1 | ||
- name: Install latest nightly | ||
run: rustup toolchain install nightly --component rustfmt --allow-downgrade | ||
- name: Check Rust formatting | ||
run: | | ||
cargo +nightly ci-fmt-external | ||
cargo-deny: | ||
name: cargo-deny (advisories, licenses, bans, ...) | ||
runs-on: [self-hosted] | ||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1 | ||
- uses: EmbarkStudios/cargo-deny-action@v1 | ||
|
||
clippy: | ||
needs: | ||
- rustfmt | ||
- cargo-deny | ||
runs-on: [self-hosted] | ||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1 | ||
- run: rustup component add clippy | ||
|
||
# See '.cargo/config' for list of enabled/disabled clippy lints | ||
- name: cargo move-clippy | ||
run: | | ||
cargo ci-clippy-external |
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Rust tests | ||
|
||
on: workflow_call | ||
|
||
jobs: | ||
changes: | ||
runs-on: [self-hosted] | ||
outputs: | ||
components: ${{ steps.filter.outputs.changes }} | ||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | ||
- uses: dorny/paths-filter@v3 | ||
id: filter | ||
with: | ||
list-files: "json" | ||
filters: .github/external-crates-filters.yml | ||
|
||
test: | ||
name: Test ${{ matrix.components }} | ||
needs: changes | ||
if: 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 | ||
# 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: Install python dependencies | ||
run: pip install pyopenssl --upgrade | ||
- name: cargo test | ||
run: > | ||
cargo nextest run | ||
--config-file .config/nextest.toml | ||
--manifest-path external-crates/move/Cargo.toml | ||
-E '!test(prove) and !test(run_all::simple_build_with_docs/args.txt) and !test(run_test::nested_deps_bad_parent/Move.toml) and rdeps(${{matrix.components}})' | ||
-p ${{matrix.components}} | ||
--profile ci |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Move tests | ||
|
||
on: workflow_call | ||
|
||
jobs: | ||
# This job ensures that Move unit tests are run if there are changes | ||
# to Move code but not Rust code (If there are Rust changes, they | ||
# will be run as part of a larger test suite). | ||
move-test: | ||
timeout-minutes: 10 | ||
runs-on: [self-hosted] | ||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1 | ||
- uses: taiki-e/install-action@nextest | ||
- name: Run move tests | ||
run: | | ||
cargo nextest run -p iota-framework-tests -- unit_tests:: |
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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Rust crates | ||
|
||
on: workflow_call | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
# Disable incremental compilation. | ||
# | ||
# Incremental compilation is useful as part of an edit-build-test-edit cycle, | ||
# as it lets the compiler avoid recompiling code that hasn't changed. However, | ||
# on CI, we're not making small edits; we're almost always building the entire | ||
# project from scratch. Thus, incremental compilation on CI actually | ||
# introduces *additional* overhead to support making future builds | ||
# faster...but no future builds will ever occur in any given CI environment. | ||
# | ||
# See https://matklad.github.io/2021/09/04/fast-rust-builds.html#ci-workflow | ||
# for details. | ||
CARGO_INCREMENTAL: 0 | ||
# Allow more retries for network requests in cargo (downloading crates) and | ||
# rustup (installing toolchains). This should help to reduce flaky CI failures | ||
# from transient network timeouts or other issues. | ||
CARGO_NET_RETRY: 10 | ||
RUSTUP_MAX_RETRIES: 10 | ||
# Don't emit giant backtraces in the CI logs. | ||
RUST_BACKTRACE: short | ||
RUSTDOCFLAGS: -D warnings | ||
|
||
jobs: | ||
rust-lints: | ||
uses: ./.github/workflows/_rust_lints.yml | ||
|
||
external-lints: | ||
uses: ./.github/workflows/_external_rust_lints.yml | ||
|
||
rust-tests: | ||
needs: | ||
- rust-lints | ||
- external-lints | ||
uses: ./.github/workflows/_rust_tests.yml | ||
|
||
external-tests: | ||
needs: | ||
- rust-lints | ||
- external-lints | ||
uses: ./.github/workflows/_external_rust_tests.yml | ||
|
||
mysticeti-tests: | ||
needs: | ||
- rust-lints | ||
- external-lints | ||
uses: ./.github/workflows/_mysticeti_tests.yml | ||
|
||
execution-cut: | ||
needs: | ||
- rust-tests | ||
- external-tests | ||
- mysticeti-tests | ||
uses: ./.github/workflows/_execution_cut.yml |
Oops, something went wrong.