Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unified tests into final step ✅ #192

Merged
Merged
18 changes: 18 additions & 0 deletions .github/workflows/check-migrations.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Check Migrations

# If you modify more jobs, ensure that you add them as required to the job "confirmMigrationsPassed"
# which is located at the end of this file (more info in the job)

on:
push:
branches: ["main", "release-*"]
Expand All @@ -16,6 +19,7 @@ concurrency:
permissions: {}

jobs:
# This generates a matrix with all the required jobs which will be run in the next step
runtime-matrix:
runs-on: ubuntu-latest
outputs:
Expand All @@ -36,6 +40,8 @@ jobs:
TASKS=$(echo $TASKS | jq -c .)
echo "runtime=$TASKS" >> $GITHUB_OUTPUT

# This runs all the jobs in the matrix. It is required by the "confirmMigrationsPassed" job, so
# if they all pass, that job will pass too.
check-migrations:
needs: [runtime-matrix]
continue-on-error: true
Expand Down Expand Up @@ -77,3 +83,15 @@ jobs:
node-uri: ${{ matrix.runtime.uri }}
checks: "pre-and-post"
extra-args: ${{ env.EXTRA_ARGS }}

# This will only run if all the tests in its "needs" array passed.
# Add this as your required job, becuase if the matrix changes size (new things get added)
# it will still require all the steps to succeed.
# If you add more jobs, remember to add them to the "needs" array.
confirmMigrationsPassed:
runs-on: ubuntu-latest
name: All migrations passed
# If any new job gets added, be sure to add it to this array
needs: [check-migrations]
steps:
- run: echo '### Good job! All the migrations passed 🚀' >> $GITHUB_STEP_SUMMARY
24 changes: 24 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: "Test all features"

# If you modify more test jobs, ensure that you add them as required to the job "confirmTestPassed"
# which is located at the end of this file (more info in the job)

on:
push:
branches: ["main", "release-*"]
Expand All @@ -12,6 +15,7 @@ concurrency:
cancel-in-progress: true

jobs:
# This generates a matrix with all the required jobs which will be run in the next step
runtime-matrix:
runs-on: ubuntu-latest
outputs:
Expand All @@ -38,6 +42,7 @@ jobs:
echo $TASKS
echo "itest=$TASKS" >> $GITHUB_OUTPUT

# Job required by "confirmTestPassed"
runtime-test:
needs: [runtime-matrix]
continue-on-error: true
Expand Down Expand Up @@ -94,6 +99,7 @@ jobs:
RUSTFLAGS: "-C debug-assertions -D warnings"
SKIP_WASM_BUILD: 1

# Job required by "confirmTestPassed"
integration-test:
needs: [integration-test-matrix]
continue-on-error: true
Expand Down Expand Up @@ -144,6 +150,7 @@ jobs:
env:
RUSTFLAGS: "-C debug-assertions -D warnings"

# Job required by "confirmTestPassed"
build-chain-spec-generator:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -190,6 +197,7 @@ jobs:
RUSTFLAGS: "-C debug-assertions -D warnings"
SKIP_WASM_BUILD: 1

# Job required by "confirmTestPassed"
zombienet-smoke:
needs: [build-chain-spec-generator]
runs-on: ubuntu-latest
Expand Down Expand Up @@ -240,3 +248,19 @@ jobs:
run: |
export PATH=$(pwd)/target/release:$PATH
cargo test --manifest-path integration-tests/zombienet/Cargo.toml

# This will only run if all the tests in its "needs" array passed.
# Add this as your required job, becuase if the matrix changes size (new things get added)
# it will still require all the steps to succeed.
# If you add more jobs, remember to add them to the "needs" array.
confirmTestPassed:
runs-on: ubuntu-latest
name: All tests passed
# If any new job gets added, be sure to add it to this list
needs:
- runtime-test
- integration-test
- build-chain-spec-generator
- zombienet-smoke
steps:
- run: echo '### Good job! All the tests passed 🚀' >> $GITHUB_STEP_SUMMARY
Loading