-
Notifications
You must be signed in to change notification settings - Fork 145
273 lines (238 loc) · 9.89 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
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
270
271
272
273
name: VCPKG Continuous Integration
on:
# Run this workflow once every 6 hours against the master branch
schedule:
- cron: "0 */6 * * *"
push:
branches:
- "master"
tags:
- "*"
pull_request:
jobs:
build_linux:
strategy:
fail-fast: false
matrix:
image:
- { name: "ubuntu", tag: "22.04" }
llvm: ["17"]
compiler:
- { CC: "clang", CXX: "clang++" }
- { CC: "gcc", CXX: "g++" }
env:
CC: ${{ matrix.compiler.CC }}
CXX: ${{ matrix.compiler.CXX }}
runs-on: ubuntu-22.04
container:
image: ghcr.io/lifting-bits/cxx-common/vcpkg-builder-${{ matrix.image.name }}:${{ matrix.image.tag }}
volumes:
- /:/gha-runner
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: ./.github/actions/prepare_git_user
- name: Clear space
shell: bash
run: |
df -h
rm -rf /gha-runner/usr/local/lib/android
rm -rf /gha-runner/usr/local/share/boost
df -h
- name: Build with build script
shell: bash
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
./scripts/build.sh --llvm-version ${{ matrix.llvm }}
mkdir remill-rel/
mv remill-build/*.deb ./remill-rel
mv remill-build/*.rpm ./remill-rel
mv remill-build/*.tar.gz ./remill-rel
rm -rf remill-build/_CPack_Packages
- name: Build with build-presets script
shell: bash
run: |
export CMAKE_TOOLCHAIN_FILE=$(pwd)/../lifting-bits-downloads/vcpkg_${{ matrix.image.name }}-${{ matrix.image.tag }}_llvm-${{ matrix.llvm }}_amd64/scripts/buildsystems/vcpkg.cmake
export INSTALL_DIR=$(pwd)/remill-preset-install
./scripts/build-preset.sh release
- name: Install Python Test Deps
shell: bash
run: |
pip3 install --user ./scripts/diff_tester_export_insns
- name: Tree size
shell: bash
run: |
du -hs
df -h
- name: Run tests
shell: bash
working-directory: remill-build
run: |
cmake --build . --target install -- -j "$(nproc)"
cmake --build . --target test_dependencies -- -j "$(nproc)"
env CTEST_OUTPUT_ON_FAILURE=1 cmake --build . --target test -- -j "$(nproc)"
- name: Tree size after
shell: bash
if: failure()
run: |
df -h
du -h $(pwd)/../ | sort -h
df -h
- name: Smoketests with installed executable
shell: bash
run: |
remill-lift-${{ matrix.llvm }} --arch amd64 --ir_out /dev/stdout --bytes c704ba01000000
remill-lift-${{ matrix.llvm }} --arch aarch64 --ir_out /dev/stdout --address 0x400544 --bytes FD7BBFA90000009000601891FD030091B7FFFF97E0031F2AFD7BC1A8C0035FD6
remill-lift-${{ matrix.llvm }} --arch aarch32 -ir_out /dev/stderr --bytes 0cd04de208008de504108de500208de508309de504009de500109de5903122e0c20fa0e110109fe5001091e5002081e5040081e50cd08de21eff2fe14000000000000000
- name: Locate the packages
id: package_names
shell: bash
working-directory: remill-rel
run: |
echo ::set-output name=DEB_PACKAGE_PATH::remill-rel/$(ls *.deb)
echo ::set-output name=RPM_PACKAGE_PATH::remill-rel/$(ls *.rpm)
echo ::set-output name=TGZ_PACKAGE_PATH::remill-rel/$(ls *.tar.gz)
- name: Store the DEB package
uses: actions/upload-artifact@v1
with:
name: ${{ matrix.image.name }}-${{ matrix.image.tag }}_llvm${{ matrix.llvm }}_deb_package
path: ${{ steps.package_names.outputs.DEB_PACKAGE_PATH }}
- name: Store the RPM package
uses: actions/upload-artifact@v1
with:
name: ${{ matrix.image.name }}-${{ matrix.image.tag }}_llvm${{ matrix.llvm }}_rpm_package
path: ${{ steps.package_names.outputs.RPM_PACKAGE_PATH }}
- name: Store the TGZ package
uses: actions/upload-artifact@v1
with:
name: ${{ matrix.image.name }}-${{ matrix.image.tag }}_llvm${{ matrix.llvm }}_tgz_package
path: ${{ steps.package_names.outputs.TGZ_PACKAGE_PATH }}
build_mac:
strategy:
fail-fast: false
matrix:
os: ["macos-13"]
llvm: ["17"]
runs-on: macos-13
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: ./.github/actions/prepare_git_user
- name: Get Poetry
shell: bash
run: |
python3 -m pip install poetry
- name: Install Python Test Deps
shell: bash
run: |
python3 -m pip install --user ./scripts/diff_tester_export_insns
- name: Build with build script
shell: bash
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
./scripts/build.sh --llvm-version ${{ matrix.llvm }}
- name: Build with build-presets script
shell: bash
run: |
brew install ninja
export CMAKE_TOOLCHAIN_FILE=$(pwd)/../lifting-bits-downloads/vcpkg_${{ matrix.os}}_llvm-${{ matrix.llvm }}_xcode-15.0_amd64/scripts/buildsystems/vcpkg.cmake
export INSTALL_DIR=$(pwd)/remill-preset-install
./scripts/build-preset.sh release
- name: Run tests
shell: bash
working-directory: remill-build
run: |
cmake --build . --target install -- -j "$(sysctl -n hw.logicalcpu)"
cmake --build . --target test_dependencies -- -j "$(sysctl -n hw.logicalcpu)"
env CTEST_OUTPUT_ON_FAILURE=1 cmake --build . --target test -- -j "$(sysctl -n hw.logicalcpu)"
- name: Smoketests with installed executable
shell: bash
run: |
remill-lift-${{ matrix.llvm }} --arch amd64 --ir_out /dev/stdout --bytes c704ba01000000
remill-lift-${{ matrix.llvm }} --arch aarch64 --ir_out /dev/stdout --address 0x400544 --bytes FD7BBFA90000009000601891FD030091B7FFFF97E0031F2AFD7BC1A8C0035FD6
remill-lift-${{ matrix.llvm }} --arch aarch32 -ir_out /dev/stderr --bytes 0cd04de208008de504108de500208de508309de504009de500109de5903122e0c20fa0e110109fe5001091e5002081e5040081e50cd08de21eff2fe14000000000000000
- name: Locate the packages
id: package_names
shell: bash
working-directory: remill-build
run: |
echo ::set-output name=TGZ_PACKAGE_PATH::remill-build/$(ls *.tar.gz)
- name: Store the TGZ package
uses: actions/upload-artifact@v1
with:
name: ${{ matrix.os }}_llvm${{ matrix.llvm }}_tgz_package
path: ${{ steps.package_names.outputs.TGZ_PACKAGE_PATH }}
release_packages:
# Do not run the release procedure if any of the builds has failed
needs: [build_linux, build_mac]
runs-on: ubuntu-22.04
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
steps:
- name: Clone the remill repository
uses: actions/checkout@v2
with:
path: remill
fetch-depth: 0
- name: Generate the changelog
shell: bash
working-directory: remill
run: |
./scripts/generate_changelog.sh changelog.md
- name: Download all artifacts
uses: actions/download-artifact@v2
- name: Draft the new release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Version ${{ github.ref }}
body_path: remill/changelog.md
draft: true
prerelease: true
- name: Group the packages by platform
run: |
zip -r9 remill_ubuntu-22.04_packages.zip \
ubuntu-22.04*
zip -r9 remill_macos-12_packages.zip \
macos-12*
- name: Upload the Ubuntu 22.04 packages
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: remill_ubuntu-22.04_packages.zip
asset_name: remill_ubuntu-22.04_packages.zip
asset_content_type: application/gzip
- name: Upload the macOS 11 packages
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: remill_macos-12_packages.zip
asset_name: remill_macos-12_packages.zip
asset_content_type: application/gzip
Docker_Linux:
runs-on: ubuntu-latest
strategy:
matrix:
llvm: ["17"]
ubuntu: ["22.04"]
steps:
- uses: actions/checkout@v2
- name: Build LLVM ${{ matrix.llvm }} on ${{ matrix.ubuntu }}
run: |
docker build . -t ghcr.io/lifting-bits/remill/remill-llvm${{ matrix.llvm }}-ubuntu${{ matrix.ubuntu }}:latest -f Dockerfile --build-arg UBUNTU_VERSION=${{ matrix.ubuntu }} --build-arg LLVM_VERSION=${{ matrix.llvm }}
- name: Test Docker image
run: |
docker run --rm ghcr.io/lifting-bits/remill/remill-llvm${{ matrix.llvm }}-ubuntu${{ matrix.ubuntu }}:latest --arch amd64 --ir_out /dev/stdout --bytes c704ba01000000
docker run --rm ghcr.io/lifting-bits/remill/remill-llvm${{ matrix.llvm }}-ubuntu${{ matrix.ubuntu }}:latest --arch aarch64 --ir_out /dev/stdout --address 0x400544 --bytes FD7BBFA90000009000601891FD030091B7FFFF97E0031F2AFD7BC1A8C0035FD6
docker run --rm ghcr.io/lifting-bits/remill/remill-llvm${{ matrix.llvm }}-ubuntu${{ matrix.ubuntu }}:latest --arch aarch32 -ir_out /dev/stderr --bytes 0cd04de208008de504108de500208de508309de504009de500109de5903122e0c20fa0e110109fe5001091e5002081e5040081e50cd08de21eff2fe14000000000000000