Skip to content

Commit 32c36c0

Browse files
committed
add downstream-ci
1 parent fed2dd1 commit 32c36c0

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed

.github/workflows/downstream-ci.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: downstream-ci
2+
3+
on:
4+
# Trigger the workflow on push to master or develop, except tag creation
5+
push:
6+
branches:
7+
- 'main'
8+
- 'develop'
9+
tags-ignore:
10+
- '**'
11+
12+
# Trigger the workflow on pull request
13+
pull_request: ~
14+
15+
# Trigger the workflow manually
16+
workflow_dispatch: ~
17+
18+
# Trigger after public PR approved for CI
19+
pull_request_target:
20+
types: [labeled]
21+
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@feat/add-earthkit-hydro
28+
with:
29+
earthkit-hydro: ecmwf/earthkit-hydro@${{ github.event.pull_request.head.sha || github.sha }}
30+
codecov_upload: true
31+
python_qa: true
32+
secrets: inherit
33+
34+
# Run CI of private downstream packages on self-hosted runners
35+
private-downstream-ci:
36+
name: private-downstream-ci
37+
needs: [downstream-ci]
38+
if: (success() || failure()) && ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }}
39+
runs-on: ubuntu-latest
40+
permissions:
41+
pull-requests: write
42+
steps:
43+
- name: Dispatch private downstream CI
44+
uses: ecmwf-actions/dispatch-private-downstream-ci@v1
45+
with:
46+
token: ${{ secrets.GH_REPO_READ_TOKEN }}
47+
owner: ecmwf-actions
48+
repository: private-downstream-ci
49+
event_type: downstream-ci
50+
payload: '{"earthkit-hydro": "ecmwf/earthkit-hydro@${{ github.event.pull_request.head.sha || github.sha }}"}'
51+
52+
# Build downstream packages on HPC
53+
downstream-ci-hpc:
54+
name: downstream-ci-hpc
55+
if: ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }}
56+
uses: ecmwf-actions/downstream-ci/.github/workflows/downstream-ci-hpc.yml@feat/add-earthkit-hydro
57+
with:
58+
earthkit-hydro: ecmwf/earthkit-hydro@${{ github.event.pull_request.head.sha || github.sha }}
59+
secrets: inherit
60+
61+
# Run CI of private downstream packages on HPC
62+
private-downstream-ci-hpc:
63+
name: private-downstream-ci-hpc
64+
needs: [downstream-ci-hpc]
65+
if: (success() || failure()) && ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }}
66+
runs-on: ubuntu-latest
67+
permissions:
68+
pull-requests: write
69+
steps:
70+
- name: Dispatch private downstream CI
71+
uses: ecmwf-actions/dispatch-private-downstream-ci@v1
72+
with:
73+
token: ${{ secrets.GH_REPO_READ_TOKEN }}
74+
owner: ecmwf-actions
75+
repository: private-downstream-ci
76+
event_type: downstream-ci-hpc
77+
payload: '{"earthkit-hydro": "ecmwf/earthkit-hydro@${{ github.event.pull_request.head.sha || github.sha }}"}'

0 commit comments

Comments
 (0)