diff --git a/.github/workflows/check-migrations.yml b/.github/workflows/check-migrations.yml index 11fa1fe9c5..72ba40db29 100644 --- a/.github/workflows/check-migrations.yml +++ b/.github/workflows/check-migrations.yml @@ -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-*"] @@ -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: @@ -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 @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e74b57668f..37d64a5b3f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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-*"] @@ -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: @@ -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 @@ -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 @@ -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: @@ -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 @@ -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