-
Notifications
You must be signed in to change notification settings - Fork 42
165 lines (132 loc) · 5.27 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
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- '**'
env:
LIEF_VERSION: 0.12.3
jobs:
coverage:
runs-on: ubuntu-latest
if: github.repository_owner == 'trailofbits'
&& false
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install Dependencies
run: |
sudo apt-get install libgmp-dev python3-dev libz3-dev
wget -O - -c https://github.com/lief-project/LIEF/releases/download/$LIEF_VERSION/LIEF-$LIEF_VERSION-Linux-x86_64.tar.gz | sudo tar xz -C /usr/local --strip-components=1
wget -O - -c https://github.com/lifting-bits/sleigh/releases/download/v10.1.2-2/Linux-sleigh-10.1.2-2.x86_64.tar.gz | sudo tar xz -C /usr/local --strip-components=1
- name: Install LCov
run: sudo apt-get update -q
&& sudo apt-get install lcov -q -y
- name: Configure
run: cmake --preset=ci-coverage
- name: Build
run: cmake --build build/coverage -j 2
- name: Test
working-directory: build/coverage
run: ctest --output-on-failure -j 2
- name: Process coverage info
run: cmake --build build/coverage -t coverage
- name: Print coverage info
run: lcov --summary build/coverage/coverage.info
#- name: Submit to codecov.io
# uses: codecov/codecov-action@v1
# with:
# file: build/coverage/coverage.info
sanitize:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install Dependencies
run: |
sudo apt-get install libgmp-dev python3-dev
# LIEF
wget -O- https://github.com/lief-project/LIEF/releases/download/$LIEF_VERSION/LIEF-$LIEF_VERSION-Linux-x86_64.tar.gz | sudo tar xz -C /usr/local --strip-components=1
# Sleigh
wget -O- https://github.com/lifting-bits/sleigh/releases/download/v10.1.2-2/Linux-sleigh-10.1.2-2.x86_64.tar.gz | sudo tar xz -C /usr/local --strip-components=1
# Z3 Ubuntu 20.04 package doesn't play nice with sanitizers
# (also remove top-level directory from zip)
wget -O z3.zip https://github.com/Z3Prover/z3/releases/download/z3-4.8.14/z3-4.8.14-x64-glibc-2.31.zip
dest=/opt/z3; zip=./z3.zip; \
sudo mkdir -p "${dest}" && \
sudo unzip -d "${dest}" "${zip}" && \
f=("${dest}"/*) && sudo mv "${dest}"/*/* "$dest" && sudo rmdir "${f[@]}"
- name: Configure
env: { CC: clang-14, CXX: clang++-14 }
run: cmake --preset=ci-sanitize -DZ3_ROOT=/opt/z3
- name: Build
run: |
cmake --build build/sanitize -j 2
- name: Test
working-directory: build/sanitize
env:
ASAN_OPTIONS: "strict_string_checks=1:\
detect_stack_use_after_return=1:\
check_initialization_order=1:\
strict_init_order=1:\
detect_leaks=1"
UBSAN_OPTIONS: print_stacktrace=1
run: ctest --output-on-failure -j 2
test:
strategy:
fail-fast: false
matrix:
os: [
# TODO: windows,
macos,
ubuntu
]
type: [shared, static]
include:
- { type: shared, shared: YES }
- { type: static, shared: NO }
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Setup Git User for Sleigh
# See this thread for more details https://github.community/t/github-actions-bot-email-address/17204/5
run: |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: Install Dependencies
if: matrix.os == 'ubuntu'
run: |
sudo apt-get install libgmp-dev python3-dev libz3-dev
python3 -m pip install pytest
wget -O - -c https://github.com/lief-project/LIEF/releases/download/$LIEF_VERSION/LIEF-$LIEF_VERSION-Linux-x86_64.tar.gz | sudo tar xz -C /usr/local --strip-components=1
wget -O - -c https://github.com/lifting-bits/sleigh/releases/download/v10.1.2-2/Linux-sleigh-10.1.2-2.x86_64.tar.gz | sudo tar xz -C /usr/local --strip-components=1
- name: Install Dependencies
if: matrix.os == 'macos'
run: |
brew install gmp z3
python3 -m pip install --user pytest
wget -O - -c https://github.com/lief-project/LIEF/releases/download/$LIEF_VERSION/LIEF-$LIEF_VERSION-Darwin-x86_64.tar.gz | sudo tar xz -C /usr/local --strip-components=1
wget -O - -c https://github.com/lifting-bits/sleigh/releases/download/v10.1.2-2/macOS-sleigh-10.1.2-2.x86_64.tar.gz | sudo tar xz -C /usr/local --strip-components=1
- name: Configure
run: cmake --preset=ci-${{ matrix.os }}
-D BUILD_SHARED_LIBS=${{ matrix.shared }}
- name: Build
run: cmake --build build --config Release -j 2
- name: Install
run: cmake --install build --config Release --prefix prefix
- name: Test install directory
working-directory: tests/find-package
run: |
cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -Dmaat_DIR=${{ github.workspace }}/prefix/share/maat
cmake --build build
./build/maat_find_package_test
- name: Test
working-directory: build
run: |
ctest --output-on-failure -C Release -j 2