Skip to content

Commit eee72af

Browse files
committed
Add CI check for many LLVM versions
1 parent de1b39a commit eee72af

File tree

1 file changed

+142
-0
lines changed

1 file changed

+142
-0
lines changed
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
name: Verify LLVM Versions
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
issue_comment: # On PR issue comment
7+
types: [ created ]
8+
9+
jobs:
10+
comment-triggered:
11+
runs-on: ubuntu-20.04
12+
13+
outputs:
14+
value: ${{ steps.value.outputs.value }}
15+
checks_should_run: ${{ steps.checks_should_run.outputs.checks_should_run }}
16+
17+
steps:
18+
- id: value
19+
# Allow triggering with a comment of `Do: Verify LLVM Versions`.
20+
# If we are a pull_request, we have the trigger comment, and the person
21+
# requesting is the one who made the PR, then we run.
22+
run: >-
23+
echo "::set-output name=value::${{ github.event_name == 'issue_comment'
24+
&& github.event.issue.pull_request != ''
25+
&& github.event.comment.body == 'Do: Verify LLVM Versions'
26+
&& github.event.comment.user.id == github.event.issue.user.id }}"
27+
28+
- id: checks_should_run
29+
run: >-
30+
echo "::set-output name=checks_should_run::${{
31+
steps.value.outputs.value == 'true'
32+
|| github.event_name == 'push'
33+
|| github.event_name == 'pull_request' }}"
34+
35+
init-report:
36+
needs: comment-triggered
37+
runs-on: ubuntu-20.04
38+
if: needs.comment-triggered.outputs.value == 'true'
39+
40+
outputs:
41+
report: ${{ steps.report.outputs.comment-id }}
42+
43+
steps:
44+
- name: Initialize Report
45+
uses: peter-evans/[email protected]
46+
id: report
47+
with:
48+
issue-number: ${{ github.event.issue.number }}
49+
body: |
50+
Verifying build methods work: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
51+
52+
external-build:
53+
needs: comment-triggered
54+
runs-on: ubuntu-${{ matrix.os }}
55+
if: needs.comment-triggered.outputs.checks_should_run == 'true'
56+
57+
strategy:
58+
fail-fast: false
59+
matrix:
60+
include:
61+
- llvm: 7
62+
os: 18.04
63+
ubuntu: bionic
64+
- llvm: 8
65+
os: 18.04
66+
ubuntu: bionic
67+
- llvm: 9
68+
os: 20.04
69+
ubuntu: focal
70+
- llvm: 10
71+
os: 20.04
72+
ubuntu: focal
73+
- llvm: 11
74+
os: 20.04
75+
ubuntu: focal
76+
- llvm: 12
77+
os: 20.04
78+
ubuntu: focal
79+
- llvm: 13
80+
os: 20.04
81+
ubuntu: focal
82+
83+
steps:
84+
- name: Install dependencies
85+
run: |
86+
# Setup LLVM GPG Key
87+
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
88+
89+
sudo add-apt-repository "deb http://apt.llvm.org/${{ matrix.ubuntu }}/ llvm-toolchain-${{ matrix.ubuntu }}-${{ matrix.llvm }} main"
90+
sudo apt-get update
91+
92+
sudo apt-get install clang++-${{ matrix.llvm }} llvm-${{ matrix.llvm }} ninja-build
93+
94+
- uses: actions/checkout@v2
95+
with:
96+
fetch-depth: 0
97+
98+
- run: |
99+
echo ${{ github.token }} | gh auth login --with-token
100+
gh pr checkout ${{ github.event.issue.number }}
101+
if: needs.comment-triggered.outputs.value == 'true'
102+
103+
- name: Configure OptSched
104+
run: |
105+
mkdir build-optsched && cd build-optsched
106+
107+
cmake .. -GNinja \
108+
-DCMAKE_BUILD_TYPE=Release \
109+
-DOPTSCHED_LLVM_VERSION=${{ matrix.llvm }} \
110+
-DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc \
111+
-DOPTSCHED_ENABLE_AMDGPU=OFF \
112+
-DCMAKE_INSTALL_PREFIX=$PWD/install
113+
114+
- name: Build OptSched
115+
working-directory: build-optsched
116+
run: ninja
117+
118+
- name: Run tests
119+
working-directory: build-optsched
120+
run: ctest -VV
121+
122+
report:
123+
needs: [comment-triggered, init-report, external-build]
124+
runs-on: ubuntu-20.04
125+
if: always()
126+
127+
steps:
128+
- name: Report CI
129+
if: needs.comment-triggered.outputs.value == 'true'
130+
uses: peter-evans/[email protected]
131+
with:
132+
comment-id: ${{ needs.init-report.outputs.report }}
133+
body: |
134+
| Check | Status |
135+
| ----- | ------ |
136+
${{
137+
format('| External Build | {0}{1}{2} |',
138+
needs.external-build.result == 'success' && '✔ Passed' || '',
139+
needs.external-build.result == 'failure' && '❌ Failed' || '',
140+
(needs.external-build.result != 'success' && needs.external-build.result != 'failure') && 'Skipped' || ''
141+
)
142+
}}

0 commit comments

Comments
 (0)