-
Notifications
You must be signed in to change notification settings - Fork 168
151 lines (140 loc) · 4.85 KB
/
globalworkflow-ci.yaml
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: gw-ci-orion
# A GitHub Action that creates a deployment for a PR, clones, builds and runs a test suite
# This workflow is triggered by a label being added to a PR
# The label name determines the environment to deploy to
# The label name must be one of the following:
# - CI-Orion-Ready
# - CI-Orion-Build
# - CI-Orion-Run
on:
pull_request:
types:
- labeled
env:
HOMEgfs: ${{ github.workspace }}/${{ github.event.pull_request.number }}
HOMEgfs_PR: ${{ github.workspace }}/${{ github.event.pull_request.number }}
RUNTESTS: ${{ github.workspace }}/${{ github.event.pull_request.number }}/RUNTESTS
MACHINE_ID: orion
jobs:
checkout-build-link:
if: github.event.label.name == 'CI-Orion-Ready'
runs-on: [self-hosted, orion-ready]
timeout-minutes: 600
steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: ${{ github.event.pull_request.number }}
- name: Checkout components
env:
HOMEgfs: ${{ github.workspace }}/${{ github.event.pull_request.number }}
run: |
cd ${{ env.HOMEgfs }}/sorc
./checkout.sh # Options e.g. -g -u can be added late
- name: Build executables
uses: actions-ecosystem/action-remove-labels@v1
if: ${{ startsWith(github.event.comment.body, '/remove-labels') }}
with:
labels: "CI-Orion-Ready"
uses: actions-ecosystem/action-add-labels@v1
if: ${{ startsWith(github.event.comment.body, '/add-labels') }}
with:
labels: "CI-Orion-Building"
run: |
cd ${{ env.HOMEgfs }}/sorc
./build_all.sh
if: ${{ failure() }}
uses: actions-ecosystem/action-remove-labels@v1
if: ${{ startsWith(github.event.comment.body, '/remove-labels') }}
with:
labels: "CI-Orion-Building"
uses: actions-ecosystem/action-add-labels@v1
if: ${{ startsWith(github.event.comment.body, '/add-labels') }}
with:
labels: "CI-Orion-Failed"
- name: Link artifacts
run: |
cd ${{ env.HOMEgfs }}/sorc
./link_workflow.sh
if: success() || failure()
uses: actions-ecosystem/action-remove-labels@v1
if: ${{ startsWith(github.event.comment.body, '/remove-labels') }}
with:
labels: "CI-Orion-Building"
if: failure()
uses: actions-ecosystem/action-add-labels@v1
if: ${{ startsWith(github.event.comment.body, '/add-labels') }}
with:
labels: "CI-Orion-Failed"
if: success()
uses: actions-ecosystem/action-add-labels@v1
if: ${{ startsWith(github.event.comment.body, '/add-labels') }}
with:
labels: "CI-Orion-Running"
create-experiments:
needs: checkout-build-link
runs-on: [self-hosted, orion-ready]
name: Create Experiments
strategy:
matrix:
pslot: ["C48_S2S"]
steps:
- name: Create Experiment: ${{ matrix.pslot }}
env:
pslot: ${{ matrix.pslot }}
run: |
cd ${{ env.HOMEgfs }}
source workflow/gw_setup.sh
source ci/platforms/orion.sh
./ci/scripts/create_experiment.py --yaml ci/cases/${{ matrix.pslot }}.yaml --dir ${{ env.HOMEgfs }}
if: failure()
uses: actions-ecosystem/action-remove-labels@v1
if: ${{ startsWith(github.event.comment.body, '/remove-labels') }}
with:
labels: "CI-Orion-Running"
uses: actions-ecosystem/action-add-labels@v1
if: ${{ startsWith(github.event.comment.body, '/add-labels') }}
with:
labels: "CI-Orion-Failed"
run-experiments:
needs: create-experiments
runs-on: [self-hosted, orion-ready]
strategy:
matrix:
pslot: ["C48_S2S"]
steps:
- name: Run Experiment: ${{ matrix.pslot }}
env:
pslot: ${{ matrix.pslot }}
EXPDIR: ${{ env.RUNTESTS }}/${{ matrix.pslot }}/EXPDIR
run: |
cd ${{ env.HOMEgfs }}
source ci/platforms/orion.sh
./ci/scripts/run-check_ci.sh
if: failure()
uses: actions-ecosystem/action-remove-labels@v1
if: ${{ startsWith(github.event.comment.body, '/remove-labels') }}
with:
labels: "CI-Orion-Running"
uses: actions-ecosystem/action-add-labels@v1
if: ${{ startsWith(github.event.comment.body, '/add-labels') }}
with:
labels: "CI-Orion-Failed"
uses: actions-ecosystem/action-create-comment@v1
if: ${{ startsWith(github.event.comment.body, '/hello') }}
with:
body: |
${{ env.HOMEgfs}}/global-workflow.log
release-lock:
needs: run-experiments
runs-on: [self-hosted, orion-ready]
steps:
- name: Release lock
uses: actions-ecosystem/action-remove-labels@v1
if: ${{ startsWith(github.event.comment.body, '/remove-labels') }}
with:
labels: "CI-Orion-Running"
uses: actions-ecosystem/action-add-labels@v1
if: ${{ startsWith(github.event.comment.body, '/add-labels') }}
with:
labels: "CI-Orion-Passed"