|
1 | 1 | name: Coverage |
2 | 2 |
|
3 | 3 | on: |
4 | | - workflow_run: |
5 | | - workflows: ["Integration Tests", "Unit Tests"] |
6 | | - types: [completed] |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + paths-ignore: |
| 8 | + - '.github/actions/release-please/**' |
| 9 | + pull_request: |
| 10 | + branches: |
| 11 | + - main |
| 12 | + |
| 13 | +permissions: |
| 14 | + contents: read |
| 15 | + checks: read |
| 16 | + actions: read |
7 | 17 |
|
8 | 18 | jobs: |
9 | | - finalize: |
| 19 | + wait-for-tests-worflows-before-upload: |
10 | 20 | runs-on: ubuntu-latest |
11 | | - if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_sha == github.sha }} |
12 | | - # Needed for listWorkflowRunsForRepo and safe defaults for token scope |
13 | | - permissions: |
14 | | - actions: read |
15 | | - contents: read |
16 | | - statuses: write |
17 | | - # Prevent multiple concurrent finalizers for the same commit |
18 | | - concurrency: |
19 | | - group: coverage-${{ github.event.workflow_run.head_sha }} |
20 | | - cancel-in-progress: true |
21 | 21 | steps: |
22 | | - - id: check |
23 | | - uses: actions/github-script@v7 |
| 22 | + - name: Wait for Unit and Integration jobs |
| 23 | + uses: kachick/wait-other-jobs@755be1ff093bd2a6a82a24bfc50ef4d9fe491a59 # v3.8.1 |
24 | 24 | with: |
25 | | - script: | |
26 | | - const workflows = await github.rest.actions.listWorkflowRunsForRepo({ |
27 | | - owner: context.repo.owner, |
28 | | - repo: context.repo.repo, |
29 | | - head_sha: context.payload.workflow_run.head_sha, |
30 | | - status: 'completed', |
31 | | - per_page: 100 |
32 | | - }); |
33 | | -
|
34 | | - const bothComplete = ['Integration Tests', 'Unit Tests'].every(name => |
35 | | - workflows.data.workflow_runs.some( |
36 | | - run => run.name === name && run.conclusion === 'success' |
37 | | - ) |
38 | | - ); |
39 | | -
|
40 | | - core.info(bothComplete ? 'Both workflows completed successfully.' : 'Waiting for other workflow to complete.'); |
41 | | - core.setOutput('ready', String(bothComplete)); |
| 25 | + skip-same-workflow: 'true' |
| 26 | + warmup-delay: 'PT2M' |
| 27 | + retry-method: 'equal_intervals' |
| 28 | + wait-list: | |
| 29 | + [ |
| 30 | + {"workflowFile": "integration-tests.yml"}, |
| 31 | + {"workflowFile": "unit-tests.yml"} |
| 32 | + ] |
| 33 | + timeout-minutes: 20 |
42 | 34 |
|
43 | | - - if: ${{ steps.check.outputs.ready == 'true' }} |
44 | | - uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b |
| 35 | + - name: Finalize Coveralls parallel build |
| 36 | + uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2 |
| 37 | + env: |
| 38 | + COVERALLS_SERVICE_NAME: github |
| 39 | + COVERALLS_SERVICE_NUMBER: ${{ github.sha }} |
45 | 40 | with: |
46 | 41 | github-token: ${{ secrets.GITHUB_TOKEN }} |
47 | 42 | parallel-finished: true |
| 43 | + carryforward: "Integration,Unit" |
0 commit comments