Skip to content

Commit b7d9c05

Browse files
committed
GitHub CI workflows
1 parent 3b50405 commit b7d9c05

File tree

4 files changed

+119
-19
lines changed

4 files changed

+119
-19
lines changed

.github/workflows/ci.yml

+61-19
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,75 @@
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+
- '**'
1211

13-
# Trigger the workflow on all pull requests
12+
# Trigger the workflow on pull request
1413
pull_request: ~
1514

16-
# Allow workflow to be dispatched on demand
15+
# Trigger the workflow manually
1716
workflow_dispatch: ~
1817

18+
# Trigger after public PR approved for CI
19+
pull_request_target:
20+
types: [labeled]
21+
1922
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
2031

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
2655
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 }}"}'

.github/workflows/label-public-pr.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Manage labels of pull requests that originate from forks
2+
name: label-public-pr
3+
4+
on:
5+
pull_request_target:
6+
types: [opened, synchronize]
7+
8+
jobs:
9+
label:
10+
uses: ecmwf-actions/reusable-workflows/.github/workflows/label-pr.yml@v2

.github/workflows/reusable-ci-hpc.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: reusable-ci-hpc
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
eccodes:
7+
required: false
8+
type: string
9+
10+
jobs:
11+
ci-hpc:
12+
name: ci-hpc
13+
uses: ecmwf-actions/reusable-workflows/.github/workflows/ci-hpc.yml@v2
14+
with:
15+
name-prefix: eccodes-
16+
build-inputs: |
17+
--package: ${{ inputs.eccodes || 'ecmwf/eccodes@develop' }}
18+
--modules: |
19+
ecbuild
20+
ninja
21+
aec
22+
--parallel: 64
23+
secrets: inherit

.github/workflows/reusable-ci.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: reusable-ci
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
eccodes:
7+
required: false
8+
type: string
9+
10+
jobs:
11+
ci:
12+
name: eccodes-ci
13+
uses: ecmwf-actions/reusable-workflows/.github/workflows/ci.yml@v2
14+
with:
15+
repository: ${{ inputs.eccodes || 'ecmwf/eccodes@develop' }}
16+
name_prefix: eccodes-
17+
build_package_inputs: |
18+
repository: ${{ inputs.eccodes || 'ecmwf/eccodes@develop' }}
19+
self_coverage: true
20+
dependencies: |
21+
ecmwf/ecbuild
22+
MathisRosenhauer/libaec@master
23+
dependency_branch: develop
24+
parallelism_factor: 8
25+
secrets: inherit

0 commit comments

Comments
 (0)