From bb00036ece23b038ffc8b0a9114046c7501c4f42 Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Thu, 5 Sep 2024 13:20:48 +0200 Subject: [PATCH 1/5] [CI] Remove duplicate jobs All of these things are already tested in Github Actions: https://github.com/paritytech/polkadot-sdk/blob/b3c2a25b73bb4854f26204068f0aec3e8577196c/.github/workflows/checks-quick.yml#L50 --- .gitlab/pipeline/check.yml | 39 -------------------------------------- 1 file changed, 39 deletions(-) diff --git a/.gitlab/pipeline/check.yml b/.gitlab/pipeline/check.yml index 2212c1aeb0a8..7d1f37dddd51 100644 --- a/.gitlab/pipeline/check.yml +++ b/.gitlab/pipeline/check.yml @@ -1,25 +1,3 @@ -# from substrate -# not sure if it's needed in monorepo -check-dependency-rules: - stage: check - extends: - - .kubernetes-env - - .test-refs-no-trigger-prs-only - variables: - CI_IMAGE: "paritytech/tools:latest" - allow_failure: true - script: - - cd substrate/ - - ../.gitlab/ensure-deps.sh - -test-rust-features: - stage: check - extends: - - .kubernetes-env - - .test-refs-no-trigger-prs-only - script: - - bash .gitlab/rust-features.sh . - job-starter: stage: check image: paritytech/tools:latest @@ -29,20 +7,3 @@ job-starter: allow_failure: true script: - echo ok - -check-rust-feature-propagation: - stage: check - extends: - - .kubernetes-env - - .common-refs - script: - - zepter run check - -check-toml-format: - stage: check - extends: - - .kubernetes-env - - .common-refs - script: - - taplo format --check --config .config/taplo.toml - - echo "Please run `taplo format --config .config/taplo.toml` to fix any toml formatting issues" From 12effd1b388641d9034868943440f76410539aa6 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Thu, 5 Sep 2024 17:31:57 +0200 Subject: [PATCH 2/5] add check-quick final job --- .github/workflows/checks-quick.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/checks-quick.yml b/.github/workflows/checks-quick.yml index ee5ac31e9caa..f7663bf22600 100644 --- a/.github/workflows/checks-quick.yml +++ b/.github/workflows/checks-quick.yml @@ -181,3 +181,20 @@ jobs: env: ASSERT_REGEX: "FAIL-CI" GIT_DEPTH: 1 + + confirm-required-checks-quick-jobs-passed: + runs-on: ubuntu-latest + name: All quick checks passed + # If any new job gets added, be sure to add it to this array + needs: + - fmt + - check-dependency-rules + - check-rust-feature-propagation + - test-rust-features + - check-toml-format + - check-workspace + - check-markdown + - check-umbrella + - check-fail-ci + steps: + - run: echo '### Good job! All the quick checks passed 🚀' >> $GITHUB_STEP_SUMMARY From 6be4f6c3715fff94a92cdf6d5d8ee04253d50c2a Mon Sep 17 00:00:00 2001 From: alvicsam Date: Fri, 6 Sep 2024 14:00:29 +0200 Subject: [PATCH 3/5] fix confirm-required-checks-quick-jobs-passed --- .github/workflows/checks-quick.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/checks-quick.yml b/.github/workflows/checks-quick.yml index f7663bf22600..59a7db11c62a 100644 --- a/.github/workflows/checks-quick.yml +++ b/.github/workflows/checks-quick.yml @@ -196,5 +196,14 @@ jobs: - check-markdown - check-umbrella - check-fail-ci + if: always() && !cancelled() steps: - - run: echo '### Good job! All the quick checks passed 🚀' >> $GITHUB_STEP_SUMMARY + - run: | + tee resultfile <<< '${{ toJSON(needs) }}' + cat resultfile | grep '"result": "failure"' + if [ $? -eq 0 ]; then + echo "### At least one required job failed ❌" >> $GITHUB_STEP_SUMMARY + exit 1 + else + echo '### Good job! All the required jobs passed 🚀' >> $GITHUB_STEP_SUMMARY + fi From 6168b7e64939d60a8c6c42d9ce9826891b4b4065 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Fri, 6 Sep 2024 14:10:59 +0200 Subject: [PATCH 4/5] fix final step --- .github/workflows/checks-quick.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checks-quick.yml b/.github/workflows/checks-quick.yml index 59a7db11c62a..957f7065cf4d 100644 --- a/.github/workflows/checks-quick.yml +++ b/.github/workflows/checks-quick.yml @@ -200,7 +200,7 @@ jobs: steps: - run: | tee resultfile <<< '${{ toJSON(needs) }}' - cat resultfile | grep '"result": "failure"' + cat resultfile | grep '"result": "failure"' || echo "All quick checks passed" if [ $? -eq 0 ]; then echo "### At least one required job failed ❌" >> $GITHUB_STEP_SUMMARY exit 1 From d948d82cf6cb0e6fec3985410fe1c4d99bab5a5a Mon Sep 17 00:00:00 2001 From: alvicsam Date: Fri, 6 Sep 2024 14:26:08 +0200 Subject: [PATCH 5/5] fix condition --- .github/workflows/checks-quick.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/checks-quick.yml b/.github/workflows/checks-quick.yml index 957f7065cf4d..96f214e9427b 100644 --- a/.github/workflows/checks-quick.yml +++ b/.github/workflows/checks-quick.yml @@ -200,8 +200,8 @@ jobs: steps: - run: | tee resultfile <<< '${{ toJSON(needs) }}' - cat resultfile | grep '"result": "failure"' || echo "All quick checks passed" - if [ $? -eq 0 ]; then + FAILURES=$(cat resultfile | grep '"result": "failure"' | wc -l) + if [ $FAILURES -gt 0 ]; then echo "### At least one required job failed ❌" >> $GITHUB_STEP_SUMMARY exit 1 else