-
Notifications
You must be signed in to change notification settings - Fork 184
189 lines (167 loc) · 7.05 KB
/
Copy pathbuild.yml
File metadata and controls
189 lines (167 loc) · 7.05 KB
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
name: Build
on: [push, pull_request]
# Automatically cancel previous runs of this workflow on the same branch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
linux:
# Skip building pull requests from the same repository
if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) }}
runs-on: ubuntu-24.04
# We use a clean container to avoid LLVM conflicts on the GH runner images
container:
image: ubuntu:24.04
strategy:
fail-fast: false
matrix:
llvm:
- "17"
- "18"
- "19"
- "20"
- "21"
- "22"
steps:
- name: Install LLVM and build tools
run: |
apt update
apt install --no-install-recommends -y \
lsb-release \
wget \
software-properties-common \
gnupg \
cmake \
ninja-build \
python-is-python3 \
python3-pip \
python3-setuptools \
python3-venv \
git
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
./llvm.sh ${{ matrix.llvm }}
apt update
apt install --no-install-recommends -y \
llvm-${{ matrix.llvm }}-dev
echo "LLVM_PREFIX=$$(llvm-config-${{ matrix.llvm }} --prefix)" >> $GITHUB_ENV
echo "CC=clang-${{ matrix.llvm }}" >> $GITHUB_ENV
echo "CXX=clang++-${{ matrix.llvm }}" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
- name: Add workspace as safe directory (necessary for docker)
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Build dependencies
run: |
cmake -G Ninja -S dependencies -B dependencies/build \
-DUSE_EXTERNAL_LLVM=ON \
-DENABLE_SLEIGH=ON \
"-DCMAKE_PREFIX_PATH:PATH=$LLVM_PREFIX"
cmake --build dependencies/build
- name: Python venv for tests
run: |
python3 -m venv .venv
.venv/bin/pip install scripts/diff_tester_export_insns
- name: Build remill
run: |
. .venv/bin/activate
cmake -G Ninja -B build \
-DREMILL_FETCH_SLEIGH=OFF \
"-DCMAKE_PREFIX_PATH:PATH=$PWD/dependencies/install" \
"-DCMAKE_INSTALL_PREFIX=$PWD/install"
cmake --build build
- name: Install remill
run: |
cmake --install build
- name: Smoketests with installed executable
run: |
install/bin/remill-lift-${{ matrix.llvm }} --arch amd64 --ir_out /dev/stdout --bytes c704ba01000000
install/bin/remill-lift-${{ matrix.llvm }} --arch aarch64 --ir_out /dev/stdout --address 0x400544 --bytes FD7BBFA90000009000601891FD030091B7FFFF97E0031F2AFD7BC1A8C0035FD6
install/bin/remill-lift-${{ matrix.llvm }} --arch aarch32 --ir_out /dev/stderr --bytes 0cd04de208008de504108de500208de508309de504009de500109de5903122e0c20fa0e110109fe5001091e5002081e5040081e50cd08de21eff2fe14000000000000000
- name: Test remill
run: |
cmake --build build --target test_dependencies
env CTEST_OUTPUT_ON_FAILURE=1 cmake --build build --target test
nix:
if: ${{ github.repository == 'lifting-bits/remill' && (github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository)) }}
strategy:
fail-fast: false
matrix:
runner:
- ubuntu-24.04
- ubuntu-24.04-arm
- macos-latest
llvm:
- "18"
- "19"
- "20"
- "21"
- "22"
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
- name: Install Nix
uses: cachix/install-nix-action@4e002c8ec80594ecd40e759629461e26c8abed15 # v31
- name: Build remill (LLVM ${{ matrix.llvm }})
run: nix build .#remill-llvm${{ matrix.llvm }}
- name: Smoketests with installed executable
run: |
./result/bin/remill-lift-${{ matrix.llvm }} --arch amd64 --ir_out /dev/stdout --bytes c704ba01000000
./result/bin/remill-lift-${{ matrix.llvm }} --arch aarch64 --ir_out /dev/stdout --address 0x400544 --bytes FD7BBFA90000009000601891FD030091B7FFFF97E0031F2AFD7BC1A8C0035FD6
./result/bin/remill-lift-${{ matrix.llvm }} --arch aarch32 --ir_out /dev/stderr --bytes 0cd04de208008de504108de500208de508309de504009de500109de5903122e0c20fa0e110109fe5001091e5002081e5040081e50cd08de21eff2fe14000000000000000
macos:
# Skip building pull requests from the same repository
if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) }}
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
llvm:
- "17"
- "18"
- "19"
- "20"
- "21"
- "22"
steps:
- name: Install LLVM
run: |
brew install llvm@${{ matrix.llvm }}
LLVM_PREFIX=$(brew --prefix llvm@${{ matrix.llvm }})
echo "LLVM_PREFIX=$LLVM_PREFIX" >> $GITHUB_ENV
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
- name: Build dependencies
run: |
cmake -G Ninja -S dependencies -B dependencies/build \
-DUSE_EXTERNAL_LLVM=ON \
-DENABLE_SLEIGH=ON \
"-DCMAKE_PREFIX_PATH:PATH=$LLVM_PREFIX"
cmake --build dependencies/build
- name: Python venv for tests
run: |
python3 -m venv .venv
.venv/bin/pip install scripts/diff_tester_export_insns
- name: Build remill
run: |
. .venv/bin/activate
cmake -G Ninja -B build \
-DREMILL_FETCH_SLEIGH=OFF \
"-DCMAKE_PREFIX_PATH:PATH=$PWD/dependencies/install" \
"-DCMAKE_INSTALL_PREFIX=$PWD/install"
cmake --build build
- name: Install remill
run: |
cmake --install build
- name: Smoketests with installed executable
run: |
install/bin/remill-lift-${{ matrix.llvm }} --arch amd64 --ir_out /dev/stdout --bytes c704ba01000000
install/bin/remill-lift-${{ matrix.llvm }} --arch aarch64 --ir_out /dev/stdout --address 0x400544 --bytes FD7BBFA90000009000601891FD030091B7FFFF97E0031F2AFD7BC1A8C0035FD6
install/bin/remill-lift-${{ matrix.llvm }} --arch aarch32 -ir_out /dev/stderr --bytes 0cd04de208008de504108de500208de508309de504009de500109de5903122e0c20fa0e110109fe5001091e5002081e5040081e50cd08de21eff2fe14000000000000000
- name: Test remill
run: |
cmake --build build --target test_dependencies
env CTEST_OUTPUT_ON_FAILURE=1 cmake --build build --target test