-
Notifications
You must be signed in to change notification settings - Fork 157
169 lines (159 loc) · 4.29 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
name: CI
on:
push:
branches:
- master
pull_request:
schedule:
# run CI every day even if no PRs/merges occur
- cron: '0 12 * * *'
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: deps
run: |
sudo apt-get update
sudo apt-get install -y clang-format
- name: lint
run: |
mkdir build && cd build
cmake ..
cmake --build . --target peparse_format
cd .. && git diff --exit-code
pe-parse:
strategy:
matrix:
platform: ["ubuntu-latest", "macos-latest"]
build-type: ["Debug", "Release"]
build-shared: ["0", "1"]
compiler:
- { CC: "clang", CXX: "clang++" }
- { CC: "gcc", CXX: "g++" }
exclude:
- platform: macos-latest
compiler: { CC: "gcc", CXX: "g++" }
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
- name: Enable ASan+UBSan Sanitizers
if: matrix.build-type == 'Debug'
run: |
echo "SANITIZER_FLAG=-DPEPARSE_USE_SANITIZER=Address,Undefined" >> $GITHUB_ENV
- name: build
env:
CC: ${{ matrix.compiler.CC }}
CXX: ${{ matrix.compiler.CXX }}
run: |
mkdir build
cd build
cmake \
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
-DBUILD_SHARED_LIBS=${{ matrix.build-shared }} \
-DPEPARSE_ENABLE_TESTING=ON \
-DPEPARSE_ENABLE_EXAMPLES=ON \
${SANITIZER_FLAG} \
..
cmake --build .
- name: test
env:
CTEST_OUTPUT_ON_FAILURE: 1
run: |
cd build && ctest -V
./dump-pe/dump-pe ../tests/assets/example.exe
pepy:
strategy:
matrix:
platform: ["ubuntu-latest", "macos-latest"]
python:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: build
run: |
python -m pip install build wheel setuptools
python -m build
- name: test distributions
run: |
for dist in dist/*; do
python -m venv test-env
./test-env/bin/python -m pip install "${dist}"
./test-env/bin/python tests/test_pepy.py tests/assets/example.exe
rm -rf test-env
done
pe-parse-windows:
strategy:
matrix:
build-arch: ["x64", "Win32"]
build-type: ["Debug", "Release"]
build-shared: ["0", "1"]
runs-on: windows-2019
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
- name: Enable ASan Sanitizers
if: matrix.build-type == 'Debug' && matrix.build-arch == 'x64'
run: |
echo "SANITIZER_FLAG=-DPEPARSE_USE_SANITIZER=Address" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
- uses: ilammy/[email protected]
with:
arch: ${{ matrix.build-arch }}
- name: build
run: |
mkdir build
cd build
cmake `
-G "Visual Studio 16 2019" `
-A ${{ matrix.build-arch }} `
-DBUILD_SHARED_LIBS=${{ matrix.build-shared }} `
-DPEPARSE_ENABLE_TESTING=ON `
-DPEPARSE_ENABLE_EXAMPLES=ON `
$Env:SANITIZER_FLAG `
..
cmake --build . --config ${{ matrix.build-type }}
- name: install
run: |
cd build
cmake --build . --config ${{ matrix.build-type }} --target install
- name: test
env:
CTEST_OUTPUT_ON_FAILURE: 1
run: |
cd build
ctest -V
.\bin\dump-pe.exe ..\tests\assets\example.exe
pepy-windows:
strategy:
matrix:
python:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: build
run: |
python -m pip install --upgrade build wheel setuptools
python -m build
- name: install
run: |
python -m pip install --user .
- name: test
run: |
python tests/test_pepy.py tests/assets/example.exe