|
| 1 | +name: CI Gate |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + - 'release/**' |
| 8 | + types: |
| 9 | + - opened |
| 10 | + - reopened |
| 11 | + - synchronize |
| 12 | + - ready_for_review |
| 13 | + push: |
| 14 | + branches: |
| 15 | + - main |
| 16 | + - 'release/**' |
| 17 | + merge_group: |
| 18 | + workflow_dispatch: |
| 19 | + |
| 20 | +concurrency: |
| 21 | + # For PRs: one run per branch; new push cancels the old run. |
| 22 | + # For push/merge_group/workflow_dispatch: unique per run so runs never cancel each other. |
| 23 | + group: >- |
| 24 | + ${{ |
| 25 | + github.event_name == 'pull_request' && |
| 26 | + format('{0}-{1}', github.workflow, github.head_ref) || |
| 27 | + format('{0}-{1}', github.workflow, github.run_id) |
| 28 | + }} |
| 29 | + cancel-in-progress: true |
| 30 | + |
| 31 | +jobs: |
| 32 | + lint: |
| 33 | + if: github.event_name == 'pull_request' |
| 34 | + uses: ./.github/workflows/lint.yml |
| 35 | + secrets: inherit |
| 36 | + |
| 37 | + tests: |
| 38 | + uses: ./.github/workflows/test-all-erigon.yml |
| 39 | + secrets: inherit |
| 40 | + |
| 41 | + race-tests: |
| 42 | + uses: ./.github/workflows/test-all-erigon-race.yml |
| 43 | + secrets: inherit |
| 44 | + |
| 45 | + hive: |
| 46 | + uses: ./.github/workflows/test-hive.yml |
| 47 | + secrets: inherit |
| 48 | + |
| 49 | + caplin: |
| 50 | + uses: ./.github/workflows/test-integration-caplin.yml |
| 51 | + secrets: inherit |
| 52 | + |
| 53 | + # Only meaningful for PRs: needs github.event.pull_request.base.sha. |
| 54 | + large-files: |
| 55 | + if: github.event_name == 'pull_request' |
| 56 | + uses: ./.github/workflows/check-large-files.yml |
| 57 | + secrets: inherit |
| 58 | + |
| 59 | + bench: |
| 60 | + uses: ./.github/workflows/test-bench.yml |
| 61 | + secrets: inherit |
| 62 | + |
| 63 | + kurtosis: |
| 64 | + uses: ./.github/workflows/test-kurtosis-assertoor.yml |
| 65 | + secrets: inherit |
| 66 | + |
| 67 | + manifest: |
| 68 | + uses: ./.github/workflows/manifest.yml |
| 69 | + secrets: inherit |
| 70 | + |
| 71 | + repro: |
| 72 | + uses: ./.github/workflows/reproducible-build.yml |
| 73 | + secrets: inherit |
| 74 | + |
| 75 | + qa-rpc-gnosis: |
| 76 | + uses: ./.github/workflows/qa-rpc-integration-tests-gnosis.yml |
| 77 | + secrets: inherit |
| 78 | + |
| 79 | + qa-rpc-remote: |
| 80 | + uses: ./.github/workflows/qa-rpc-integration-tests-remote.yml |
| 81 | + secrets: inherit |
| 82 | + |
| 83 | + ci-gate: |
| 84 | + if: always() |
| 85 | + needs: |
| 86 | + - lint |
| 87 | + - tests |
| 88 | + - race-tests |
| 89 | + - hive |
| 90 | + - caplin |
| 91 | + - large-files |
| 92 | + - bench |
| 93 | + - kurtosis |
| 94 | + - manifest |
| 95 | + - repro |
| 96 | + - qa-rpc-gnosis |
| 97 | + - qa-rpc-remote |
| 98 | + runs-on: ubuntu-latest |
| 99 | + steps: |
| 100 | + - name: Check all required jobs |
| 101 | + run: | |
| 102 | + echo '${{ toJSON(needs) }}' > needs.json |
| 103 | + failed=$(jq -r 'to_entries[] | select(.value.result == "failure" or .value.result == "cancelled") | .key' needs.json) |
| 104 | + if [ -n "$failed" ]; then |
| 105 | + echo "The following jobs failed or were cancelled:" |
| 106 | + echo "$failed" |
| 107 | + exit 1 |
| 108 | + fi |
| 109 | + echo "All required jobs passed or were skipped." |
0 commit comments