Skip to content

Commit 2b8be1d

Browse files
authored
Add downstream ci (ecmwf#72)
1 parent 2280161 commit 2b8be1d

File tree

4 files changed

+118
-14
lines changed

4 files changed

+118
-14
lines changed

‎.github/ci-config.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dependency_branch: develop
2+
parallelism_factor: 8

‎.github/ci-hpc-config.yml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
build:
2+
modules:
3+
- ninja
4+
parallel: 64
5+

‎.github/workflows/ci-single.yml‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: ci-single
2+
3+
# Controls when the workflow will run
4+
on:
5+
6+
# Trigger the workflow on all pushes, except on tag creation
7+
push:
8+
branches:
9+
- '**'
10+
tags-ignore:
11+
- '**'
12+
13+
# Trigger the workflow on all pull requests
14+
pull_request: ~
15+
16+
# Allow workflow to be dispatched on demand
17+
workflow_dispatch: ~
18+
19+
jobs:
20+
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@v2
26+
with:
27+
skip_matrix_jobs: |
28+
clang@rocky-8.6

‎.github/workflows/ci.yml‎

Lines changed: 83 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,97 @@
11
name: ci
22

3-
# Controls when the workflow will run
43
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
75
push:
86
branches:
9-
- '**'
7+
- "master"
8+
- "develop"
109
tags-ignore:
11-
- '**'
10+
- "**"
11+
paths-ignore:
12+
- "docs/**"
13+
- "bamboo/**"
14+
- "README.rst"
1215

13-
# Trigger the workflow on all pull requests
16+
# Trigger the workflow on pull request
1417
pull_request: ~
1518

16-
# Allow workflow to be dispatched on demand
19+
# Trigger the workflow manually
1720
workflow_dispatch: ~
1821

22+
# Trigger after public PR approved for CI
23+
pull_request_target:
24+
types: [labeled]
25+
26+
1927
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
2037

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@v2
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
2661
with:
27-
skip_matrix_jobs: |
28-
clang@rocky-8.6
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

Comments
 (0)