-
Notifications
You must be signed in to change notification settings - Fork 17
269 lines (223 loc) · 9.34 KB
/
build-methods.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
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
name: Verify Build Methods
on:
push:
branches: [ master ]
issue_comment: # On PR issue comment
types: [ created ]
env:
CCACHE_BASEDIR: $GITHUB_WORKSPACE
CCACHE_DIR: $GITHUB_WORKSPACE/.ccache
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 6
jobs:
comment-triggered:
runs-on: ubuntu-18.04
outputs:
value: ${{ steps.value.outputs.value }}
checks_should_run: ${{ steps.checks_should_run.outputs.checks_should_run }}
steps:
- id: value
# Allow triggering with a comment of `Do: Verify Build Methods`.
# If we are a pull_request, we have the trigger comment, and the person
# requesting is the one who made the PR, then we run.
run: >-
echo "::set-output name=value::${{ github.event_name == 'issue_comment'
&& github.event.issue.pull_request != ''
&& github.event.comment.body == 'Do: Verify Build Methods'
&& github.event.comment.user.id == github.event.issue.user.id }}"
- id: checks_should_run
run: >-
echo "::set-output name=checks_should_run::${{
steps.value.outputs.value == 'true'
|| github.event_name == 'push'
|| github.event_name == 'pull_request' }}"
init-report:
needs: comment-triggered
runs-on: ubuntu-18.04
if: needs.comment-triggered.outputs.value == 'true'
outputs:
report: ${{ steps.report.outputs.comment-id }}
steps:
- name: Initialize Report
uses: peter-evans/[email protected]
id: report
with:
issue-number: ${{ github.event.issue.number }}
body: |
Verifying build methods work: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
# super-build: -- Done as part of the checks.yml file
manual-build:
needs: comment-triggered
runs-on: ubuntu-18.04
if: needs.comment-triggered.outputs.checks_should_run == 'true'
steps:
- name: Install dependencies
run: |
sudo apt-get install ninja-build
sudo apt-get install ccache
- run: |
git clone https://github.com/llvm/llvm-project
cd llvm-project && git checkout release/6.x
- uses: actions/checkout@v2
with:
fetch-depth: 0
path: llvm-project/llvm/projects/OptSched
- run: |
echo ${{ github.token }} | gh auth login --with-token
gh pr checkout ${{ github.event.issue.number }}
if: needs.comment-triggered.outputs.value == 'true'
working-directory: llvm-project/llvm/projects/OptSched
- name: Apply Spilling Info Patch
run: |
wget https://raw.githubusercontent.com/CSUS-LLVM/OptSched/master/patches/llvm6.0/llvm6-print-spilling-info.patch
cd llvm-project
git -c user.name="GitHub Actions" -c user.email="[email protected]" am ../llvm6-print-spilling-info.patch
- name: Set up ccache
uses: actions/[email protected]
with:
path: .ccache
key: ccache-manual
- run: |
ccache -o hash_dir=false
- name: Configure
run: |
mkdir build && cd build
cmake ../llvm-project/llvm -GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_PARALLEL_LINK_JOBS=1 \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DOPTSCHED_EXTRA_DEFINITIONS='-DIS_DEBUG' \
-DLLVM_INCLUDE_TESTS=ON \
-DOPTSCHED_ENABLE_AMDGPU=OFF
- name: Build
working-directory: build
run: |
# Zero out stats so we get an accurate report at the end.
ccache -z
# Build multiple times to avoid spurious problems with improperly set up CMake
# target dependencies by LLVM.
ninja || true
(ninja | grep -E -v '^-- Up-to-date: ') || true
(ninja | grep -E -v '^-- Up-to-date: ') || true
(ninja | grep -E -v '^-- Up-to-date: ') || true
(ninja | grep -E -v '^-- Up-to-date: ')
- name: Dump ccache Statistics
run: ccache -s
- name: Run tests
working-directory: build
run: ctest -VV
external-build:
needs: comment-triggered
runs-on: ubuntu-18.04
if: needs.comment-triggered.outputs.checks_should_run == 'true'
steps:
- name: Install dependencies
run: |
sudo apt-get install ninja-build
sudo apt-get install ccache
- run: |
git clone https://github.com/llvm/llvm-project
cd llvm-project && git checkout release/6.x
- name: Apply Spilling Info Patch
run: |
wget https://raw.githubusercontent.com/CSUS-LLVM/OptSched/master/patches/llvm6.0/llvm6-print-spilling-info.patch
cd llvm-project
git -c user.name="GitHub Actions" -c user.email="[email protected]" am ../llvm6-print-spilling-info.patch
- name: Set up ccache
uses: actions/[email protected]
with:
path: .ccache
key: ccache-external
- run: |
ccache -o hash_dir=false
- name: Configure LLVM
run: |
mkdir build-llvm && cd build-llvm
cmake ../llvm-project/llvm -GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_PARALLEL_LINK_JOBS=1 \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DLLVM_INCLUDE_TESTS=ON \
-DLLVM_ENABLE_PROJECTS='clang' \
-DCMAKE_INSTALL_PREFIX=$PWD/install
- name: Build LLVM
working-directory: build-llvm
run: |
# Zero out stats so we get an accurate report at the end.
ccache -z
# Build multiple times to avoid spurious problems with improperly set up CMake
# target dependencies by LLVM.
ninja || true
(ninja | grep -E -v '^-- Up-to-date: ') || true
(ninja | grep -E -v '^-- Up-to-date: ') || true
(ninja | grep -E -v '^-- Up-to-date: ') || true
(ninja | grep -E -v '^-- Up-to-date: ')
ninja install
# Now checkout and build OptSched
- uses: actions/checkout@v2
with:
fetch-depth: 0
path: OptSched
- run: |
echo ${{ github.token }} | gh auth login --with-token
gh pr checkout ${{ github.event.issue.number }}
if: needs.comment-triggered.outputs.value == 'true'
working-directory: OptSched
- name: Configure OptSched
run: |
mkdir build-optsched && cd build-optsched
cmake ../OptSched -GNinja \
-DCMAKE_BUILD_TYPE=Debug \
-DLLVM_DIR=../build-llvm/install/lib/cmake/llvm \
-DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc \
-DOPTSCHED_ENABLE_AMDGPU=OFF \
-DCMAKE_INSTALL_PREFIX=$PWD/install
- name: Build OptSched
working-directory: build-optsched
run: |
# Zero out stats so we get an accurate report at the end.
ccache -z
# Build multiple times to avoid spurious problems with improperly set up CMake
# target dependencies by LLVM.
ninja || true
(ninja | grep -E -v '^-- Up-to-date: ') || true
(ninja | grep -E -v '^-- Up-to-date: ') || true
(ninja | grep -E -v '^-- Up-to-date: ') || true
(ninja | grep -E -v '^-- Up-to-date: ')
ninja install
- name: Dump ccache Statistics
run: ccache -s
- name: Run tests
working-directory: build-optsched
run: ctest -VV
report:
needs: [comment-triggered, init-report, manual-build, external-build]
runs-on: ubuntu-18.04
if: always()
steps:
- name: Report CI
if: needs.comment-triggered.outputs.value == 'true'
uses: peter-evans/[email protected]
with:
comment-id: ${{ needs.init-report.outputs.report }}
body: |
| Check | Status |
| ----- | ------ |
${{
format('| Manual Build | {0}{1}{2} |',
needs.manual-build.result == 'success' && '✔ Passed' || '',
needs.manual-build.result == 'failure' && '❌ Failed' || '',
(needs.manual-build.result != 'success' && needs.manual-build.result != 'failure') && 'Skipped' || ''
)
}}
${{
format('| External Build | {0}{1}{2} |',
needs.external-build.result == 'success' && '✔ Passed' || '',
needs.external-build.result == 'failure' && '❌ Failed' || '',
(needs.external-build.result != 'success' && needs.external-build.result != 'failure') && 'Skipped' || ''
)
}}