-
Notifications
You must be signed in to change notification settings - Fork 71
87 lines (85 loc) · 2.9 KB
/
gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: GitLab CI
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
#
# Deferred GitLab pipelines at gitlab.dkrz.de (see .gitlab/dkrz.yml):
#
trigger:
if: |
github.repository_owner == 'earth-system-radiation' &&
( github.event_name != 'pull_request' ||
( github.event.pull_request.head.repo.owner.login == github.repository_owner &&
github.event.pull_request.user.login != 'dependabot[bot]' ))
runs-on: ubuntu-latest
outputs:
ref-type: ${{ steps.g-push-rev.outputs.ref-type }}
ref-name: ${{ steps.g-push-rev.outputs.ref-name }}
pipeline-id: ${{ steps.gl-trigger-pipeline.outputs.pipeline-id }}
steps:
- name: Check out GitHub repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Push to GitLab repository
id: g-push-rev
uses: "skosukhin/git-ci-hub-lab/g-push-rev@v1"
with:
remote-url: ${{ vars.DKRZ_GITLAB_SERVER }}/${{ vars.DKRZ_GITLAB_PROJECT }}.git
password: ${{ secrets.DKRZ_GITLAB_TOKEN }}
rev-id: ${{ github.sha }}
rev-signing-format: ssh
rev-signing-key: ${{ secrets.GITLAB_SIGNING_KEY }}
ref-type: branch
force-push: true
- name: Trigger GitLab CI/CD Pipeline
id: gl-trigger-pipeline
uses: "skosukhin/git-ci-hub-lab/gl-trigger-pipeline@v1"
with:
server-url: ${{ vars.DKRZ_GITLAB_SERVER }}
project-name: ${{ vars.DKRZ_GITLAB_PROJECT }}
token: ${{ secrets.DKRZ_GITLAB_TRIGGER_TOKEN }}
ref-name: ${{ steps.g-push-rev.outputs.ref-name }}
expected-sha: ${{ steps.g-push-rev.outputs.ref-commit }}
attach:
runs-on: ubuntu-latest
needs: trigger
strategy:
fail-fast: false
matrix:
config-name:
- cce-gpu-openacc-DP
- cce-gpu-openacc-SP
- nag-cpu-accel-DP
- nag-cpu-default-SP
- nvhpc-gpu-openacc-DP
- nvhpc-gpu-openacc-SP
steps:
- name: Build, run and check (fetch the log)
uses: "skosukhin/git-ci-hub-lab/gl-attach-job@v1"
with:
server-url: ${{ vars.DKRZ_GITLAB_SERVER }}
project-name: ${{ vars.DKRZ_GITLAB_PROJECT }}
token: ${{ secrets.DKRZ_GITLAB_TOKEN }}
pipeline-id: ${{ needs.trigger.outputs.pipeline-id }}
job-name: ${{ matrix.config-name }}
cleanup:
runs-on: ubuntu-latest
needs: [trigger, attach]
if: always() && needs.trigger.result != 'skipped'
continue-on-error: true
steps:
- uses: "skosukhin/git-ci-hub-lab/g-delete-ref@v1"
with:
remote-url: ${{ vars.DKRZ_GITLAB_SERVER }}/${{ vars.DKRZ_GITLAB_PROJECT }}.git
password: ${{ secrets.DKRZ_GITLAB_TOKEN }}
ref-type: ${{ needs.trigger.outputs.ref-type }}
ref-name: ${{ needs.trigger.outputs.ref-name }}
force: true