|
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 | + - "**" |
| 11 | + paths-ignore: |
| 12 | + - "docs/**" |
| 13 | + - "bamboo/**" |
| 14 | + - "README.rst" |
12 | 15 |
|
13 |
| - # Trigger the workflow on all pull requests |
| 16 | + # Trigger the workflow on pull request |
14 | 17 | pull_request: ~
|
15 | 18 |
|
16 |
| - # Allow workflow to be dispatched on demand |
| 19 | + # Trigger the workflow manually |
17 | 20 | workflow_dispatch: ~
|
18 | 21 |
|
| 22 | + # Trigger after public PR approved for CI |
| 23 | + pull_request_target: |
| 24 | + types: [labeled] |
| 25 | + |
| 26 | + |
19 | 27 | jobs:
|
| 28 | + # Run CI including downstream packages on self-hosted runners |
| 29 | + downstream-ci: |
| 30 | + name: downstream-ci |
| 31 | + if: ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }} |
| 32 | + uses: ecmwf-actions/downstream-ci/.github/workflows/downstream-ci.yml@main |
| 33 | + with: |
| 34 | + ecbuild: ecmwf/ecbuild@${{ github.event.pull_request.head.sha || github.sha }} |
| 35 | + codecov_upload: false |
| 36 | + secrets: inherit |
20 | 37 |
|
21 |
| - # Calls a reusable CI workflow to build & test the current repository. |
22 |
| - # We skip jobs that will result in duplicate artifacts, since the code does not depend on the compiler. |
23 |
| - ci: |
24 |
| - name: ci |
25 |
| - uses: ecmwf-actions/reusable-workflows/.github/workflows/ci.yml@v1 |
| 38 | + # Run CI of private downstream packages on self-hosted runners |
| 39 | + private-downstream-ci: |
| 40 | + name: private-downstream-ci |
| 41 | + needs: [downstream-ci] |
| 42 | + if: (success() || failure()) && ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }} |
| 43 | + runs-on: ubuntu-latest |
| 44 | + permissions: |
| 45 | + pull-requests: write |
| 46 | + steps: |
| 47 | + - name: Dispatch private downstream CI |
| 48 | + uses: ecmwf-actions/dispatch-private-downstream-ci@v1 |
| 49 | + with: |
| 50 | + token: ${{ secrets.GH_REPO_READ_TOKEN }} |
| 51 | + owner: ecmwf-actions |
| 52 | + repository: private-downstream-ci |
| 53 | + event_type: downstream-ci |
| 54 | + payload: '{"ecbuild": "ecmwf/ecbuild@${{ github.event.pull_request.head.sha || github.sha }}"}' |
| 55 | + |
| 56 | + # Build downstream packages on HPC |
| 57 | + downstream-ci-hpc: |
| 58 | + name: downstream-ci-hpc |
| 59 | + if: ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }} |
| 60 | + uses: ecmwf-actions/downstream-ci/.github/workflows/downstream-ci-hpc.yml@main |
26 | 61 | with:
|
27 |
| - skip_matrix_jobs: | |
28 |
| - |
29 |
| - |
30 |
| - |
| 62 | + ecbuild: ecmwf/ecbuild@${{ github.event.pull_request.head.sha || github.sha }} |
| 63 | + secrets: inherit |
| 64 | + |
| 65 | + # Run CI of private downstream packages on HPC |
| 66 | + private-downstream-ci-hpc: |
| 67 | + name: private-downstream-ci-hpc |
| 68 | + needs: [downstream-ci-hpc] |
| 69 | + if: (success() || failure()) && ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }} |
| 70 | + runs-on: ubuntu-latest |
| 71 | + permissions: |
| 72 | + pull-requests: write |
| 73 | + steps: |
| 74 | + - name: Dispatch private downstream CI |
| 75 | + uses: ecmwf-actions/dispatch-private-downstream-ci@v1 |
| 76 | + with: |
| 77 | + token: ${{ secrets.GH_REPO_READ_TOKEN }} |
| 78 | + owner: ecmwf-actions |
| 79 | + repository: private-downstream-ci |
| 80 | + event_type: downstream-ci-hpc |
| 81 | + payload: '{"ecbuild": "ecmwf/ecbuild@${{ github.event.pull_request.head.sha || github.sha }}","skip_matrix_jobs": "nvidia-22.11"}' |
| 82 | + |
| 83 | +# DISABLED FOR NOW UNTIL REPO IS SET UP FOR THIS |
| 84 | +# notify: |
| 85 | +# runs-on: ubuntu-latest |
| 86 | +# needs: |
| 87 | +# - downstream-ci |
| 88 | +# - private-downstream-ci |
| 89 | +# - downstream-ci-hpc |
| 90 | +# - private-downstream-ci-hpc |
| 91 | +# if: ${{ always() && !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }} |
| 92 | +# steps: |
| 93 | +# - name: Trigger Teams notification |
| 94 | +# uses: ecmwf-actions/notify-teams@v1 |
| 95 | +# with: |
| 96 | +# incoming_webhook: ${{ secrets.MS_TEAMS_INCOMING_WEBHOOK }} |
| 97 | +# needs_context: ${{ toJSON(needs) }} |
0 commit comments