|
1 | 1 | name: ci
|
2 | 2 |
|
3 |
| -# Controls when the workflow will run |
4 | 3 | on:
|
5 |
| - |
6 |
| - # Trigger the workflow on all pushes, except on tag creation |
| 4 | + # Trigger the workflow on push to master or develop, except tag creation |
7 | 5 | push:
|
8 | 6 | branches:
|
9 |
| - - '**' |
| 7 | + - 'master' |
| 8 | + - 'develop' |
10 | 9 | tags-ignore:
|
11 |
| - - '**' |
| 10 | + - '**' |
12 | 11 |
|
13 |
| - # Trigger the workflow on all pull requests |
| 12 | + # Trigger the workflow on pull request |
14 | 13 | pull_request: ~
|
15 | 14 |
|
16 |
| - # Allow workflow to be dispatched on demand |
| 15 | + # Trigger the workflow manually |
17 | 16 | workflow_dispatch: ~
|
18 | 17 |
|
| 18 | + # Trigger after public PR approved for CI |
| 19 | + pull_request_target: |
| 20 | + types: [labeled] |
| 21 | + |
19 | 22 | jobs:
|
| 23 | + # Run CI including downstream packages on self-hosted runners |
| 24 | + downstream-ci: |
| 25 | + name: downstream-ci |
| 26 | + if: ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }} |
| 27 | + uses: ecmwf-actions/downstream-ci/.github/workflows/downstream-ci.yml@main |
| 28 | + with: |
| 29 | + eccodes: ecmwf/eccodes@${{ github.event.pull_request.head.sha || github.sha }} |
| 30 | + secrets: inherit |
20 | 31 |
|
21 |
| - # Calls a reusable CI workflow to build & test the current repository. |
22 |
| - # It will pull in all needed dependencies and produce a code coverage report on success. |
23 |
| - ci: |
24 |
| - name: ci |
25 |
| - uses: ecmwf-actions/reusable-workflows/.github/workflows/ci.yml@v1 |
| 32 | + # Run CI of private downstream packages on self-hosted runners |
| 33 | + private-downstream-ci: |
| 34 | + name: private-downstream-ci |
| 35 | + needs: [downstream-ci] |
| 36 | + if: (success() || failure()) && ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }} |
| 37 | + runs-on: ubuntu-latest |
| 38 | + permissions: |
| 39 | + pull-requests: write |
| 40 | + steps: |
| 41 | + - name: Dispatch private downstream CI |
| 42 | + uses: ecmwf-actions/dispatch-private-downstream-ci@v1 |
| 43 | + with: |
| 44 | + token: ${{ secrets.GH_REPO_READ_TOKEN }} |
| 45 | + owner: ecmwf-actions |
| 46 | + repository: private-downstream-ci |
| 47 | + event_type: downstream-ci |
| 48 | + payload: '{"eccodes": "ecmwf/eccodes@${{ github.event.pull_request.head.sha || github.sha }}"}' |
| 49 | + |
| 50 | + # Build downstream packages on HPC |
| 51 | + downstream-ci-hpc: |
| 52 | + name: downstream-ci-hpc |
| 53 | + if: ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }} |
| 54 | + uses: ecmwf-actions/downstream-ci/.github/workflows/downstream-ci-hpc.yml@main |
26 | 55 | with:
|
27 |
| - codecov_upload: true |
28 |
| - build_package_inputs: | |
29 |
| - self_coverage: true |
30 |
| - dependencies: | |
31 |
| - ecmwf/ecbuild |
32 |
| - MathisRosenhauer/libaec@master |
33 |
| - dependency_branch: develop |
| 56 | + eccodes: ecmwf/eccodes@${{ github.event.pull_request.head.sha || github.sha }} |
| 57 | + secrets: inherit |
| 58 | + |
| 59 | + # Run CI of private downstream packages on HPC |
| 60 | + private-downstream-ci-hpc: |
| 61 | + name: private-downstream-ci-hpc |
| 62 | + needs: [downstream-ci-hpc] |
| 63 | + if: (success() || failure()) && ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }} |
| 64 | + runs-on: ubuntu-latest |
| 65 | + permissions: |
| 66 | + pull-requests: write |
| 67 | + steps: |
| 68 | + - name: Dispatch private downstream CI |
| 69 | + uses: ecmwf-actions/dispatch-private-downstream-ci@v1 |
| 70 | + with: |
| 71 | + token: ${{ secrets.GH_REPO_READ_TOKEN }} |
| 72 | + owner: ecmwf-actions |
| 73 | + repository: private-downstream-ci |
| 74 | + event_type: downstream-ci-hpc |
| 75 | + payload: '{"eccodes": "ecmwf/eccodes@${{ github.event.pull_request.head.sha || github.sha }}"}' |
0 commit comments