forked from diffkemp/diffkemp
-
Notifications
You must be signed in to change notification settings - Fork 0
200 lines (174 loc) · 5.52 KB
/
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
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
name: CI
on: [push, pull_request]
env:
KERNELS: >
3.10.0-514.el7
3.10.0-693.el7
3.10.0-862.el7
3.10.0-957.el7
4.18.0-80.el8
4.18.0-147.el8
4.18.0-193.el8
4.18.0-240.el8
3.10
4.11
jobs:
cache-kernels:
runs-on: ubuntu-20.04
steps:
- name: Cache Linux Kernels
id: kernel-cache
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/kernel
key: kernels-${{ env.KERNELS }}
lookup-only: true
- name: Install Dependencies
if: steps.kernel-cache.outputs.cache-hit != 'true'
run: sudo apt-get install gcc-7 libelf-dev
- name: Set GCC Version for Kernel Builds
if: steps.kernel-cache.outputs.cache-hit != 'true'
run: sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 100
- name: Obtain Linux Kernels
if: steps.kernel-cache.outputs.cache-hit != 'true'
working-directory: ${{ github.workspace }}
run: |
mkdir -p ${{ github.workspace }}/kernel
git clone https://github.com/viktormalik/rhel-kernel-get.git
pip3 install -r rhel-kernel-get/requirements.txt
for k in $KERNELS; do
rhel-kernel-get/rhel-kernel-get $k --output-dir kernel
done
build-and-test:
needs: cache-kernels
runs-on: ubuntu-20.04
strategy:
matrix:
llvm: [9, 10, 11, 12, 13, 14, 15, 16]
env:
- CC: gcc-9
CXX: g++-9
asan: [OFF]
regression-tests: [true]
include:
- llvm: 16
env:
CC: clang
CXX: clang++
asan: OFF
regression-tests: true
- llvm: 14
env:
CC: gcc-9
CXX: g++-9
asan: ON
regression-tests: false
steps:
- uses: actions/checkout@v3
- name: Delete unused software
run: |
sudo rm -rf /usr/local/lib/android
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache/CodeQL
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install Dependencies
working-directory: ${{ github.workspace }}
shell: bash
run: |
sudo apt-get install bc cscope libelf-dev ninja-build
pip install -r requirements.txt
- name: Install LLVM
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-${{ matrix.llvm }} main"
sudo apt-get update
sudo apt-get install llvm-${{ matrix.llvm }} llvm-${{ matrix.llvm }}-dev clang-${{ matrix.llvm }}
sudo ln -s /usr/lib/llvm-${{ matrix.llvm }} /usr/local/lib/llvm
echo "/usr/lib/llvm-${{ matrix.llvm }}/bin" >> $GITHUB_PATH
- name: Restore Kernels
uses: actions/cache/restore@v3
if: matrix.regression-tests
with:
path: ${{ github.workspace }}/kernel
key: kernels-${{ env.KERNELS }}
fail-on-cache-miss: true
- name: Prepare Build Environment
run: |
mkdir -p ${{ github.workspace }}/build
- name: CMake
env: ${{ matrix.env }}
working-directory: ${{ github.workspace }}/build
shell: bash
run: cmake $GITHUB_WORKSPACE -GNinja -DSANITIZE_ADDRESS=${{ matrix.asan }}
- name: Build
env: ${{ matrix.env }}
working-directory: ${{ github.workspace }}/build
run: ninja
- name: Install
env: ${{ matrix.env }}
working-directory: ${{ github.workspace }}
run: pip3 install -e .
- name: Run Unit Tests
working-directory: ${{ github.workspace }}
run: |
tests/unit_tests/simpll/runTests
- name: Run Regression Tests
if: matrix.regression-tests
working-directory: ${{ github.workspace }}
run: |
pytest tests
code-style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install Dependencies
working-directory: ${{ github.workspace }}
shell: bash
run: |
sudo apt-get install clang-format
pip install flake8
- name: Check Coding Style
working-directory: ${{ github.workspace }}
shell: bash
run: |
flake8 diffkemp --exclude=llreve --ignore=F403,F405,W504
flake8 tests
tools/check-clang-format.sh -d
result-viewer:
runs-on: ubuntu-latest
strategy:
matrix:
node: [14.x, 16.x, 18.x, 20.x]
steps:
- uses: actions/checkout@v3
- name: Setup Node ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Install dependencies and cache them
uses: cypress-io/github-action@v5
with:
runTests: false
working-directory: view
- name: Run RTL tests
run: npm test --prefix view
- name: Run Cypress tests
uses: cypress-io/github-action@v5
with:
install: false
component: true
browser: firefox
working-directory: view
config: video=false,screenshotOnRunFailure=false
- name: Check coding style with ESLint
run: npm run lint --prefix view
- name: Create build
run: CI=false npm run build --prefix view