-
Notifications
You must be signed in to change notification settings - Fork 2
166 lines (137 loc) · 4.2 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
on:
push:
branches: ["master"]
tags: ["*"]
pull_request:
branches: ["master"]
name: Continuous integration
jobs:
native:
runs-on: ubuntu-latest
steps:
- name: Install packages
run: export DEBIAN_FRONTEND=noninteractive &&
sudo apt-get update &&
sudo apt-get install -y
black
ccache
cmake
g++
gcc
git
libboost-dev
libboost-python-dev
libc6-dev-i386
libcapstone-dev
libdw-dev
python3
python3-flake8
python3-pip
python3-skbuild
python3-venv
quilt
make
ninja-build
- uses: actions/checkout@v4
with:
submodules: "true"
- name: Generate a timestamp
run: echo "TIMESTAMP=$(date +%Y%m%d%H%M%S)" >>"$GITHUB_ENV"
- uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.ccache
key: native-${{ env.TIMESTAMP }}
restore-keys: native-
- name: Configure ccache
run: echo "CCACHE_DIR=$HOME/.ccache" >>"$GITHUB_ENV"
- name: Show ccache stats
run: ccache --show-stats --verbose
- name: Check formatting
run: ./fmt --check
- name: Build a source distribution
run: python3 setup.py sdist
- name: Build
run: PATH=/usr/lib/ccache:$PATH ./ci
--skip-repair
-DVALGRIND_CONFIGURE_FLAGS=--disable-dependency-tracking
--sanitize
- name: Smoke test
run: python3 -m pip install --user dist/wheelhouse/*.whl &&
./python3-asan "$(command -v memtrace)" record true &&
./python3-asan "$(command -v memtrace)" report | tail
- name: Show and reset ccache stats
run: ccache --show-stats --verbose --zero-stats
- uses: actions/upload-artifact@v4
with:
name: native
path: dist/
cross:
strategy:
matrix:
arch: [aarch64,arm,i686,ppc64,ppc64le,s390x,x86_64]
python: [cp36-cp36m,cp37-cp37m,cp38-cp38,cp39-cp39,cp310-cp310,cp311-cp311,cp312-cp312]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: "true"
- name: Generate a timestamp
run: echo "TIMESTAMP=$(date +%Y%m%d%H%M%S)" >>"$GITHUB_ENV"
- uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.ccache
key: cross-${{ matrix.arch }}-${{ matrix.python }}-${{ env.TIMESTAMP }}
restore-keys: cross-${{ matrix.arch }}-${{ matrix.python }}-
- name: Pull the Docker image
run: ./in-docker
--arch=${{ matrix.arch }}
--python=${{ matrix.python }}
true
- name: Show ccache stats
run: ./in-docker
--arch=${{ matrix.arch }}
--python=${{ matrix.python }}
ccache --show-stats --verbose
- name: Build
run: ./ci-docker
--arch=${{ matrix.arch }}
--python=${{ matrix.python }}
-DVALGRIND_CONFIGURE_FLAGS=--disable-dependency-tracking
- name: Show and reset ccache stats
run: ./in-docker
--arch=${{ matrix.arch }}
--python=${{ matrix.python }}
ccache --show-stats --verbose --zero-stats
- uses: actions/upload-artifact@v4
with:
name: cross-${{ matrix.arch }}-${{ matrix.python }}
path: dist/
PyPI:
runs-on: ubuntu-latest
needs:
- native
- cross
if: startsWith(github.ref, 'refs/tags/')
environment: PyPI
steps:
- name: Install packages
run: export DEBIAN_FRONTEND=noninteractive &&
sudo apt-get update &&
sudo apt-get install -y
tree
twine
unzip
- uses: actions/download-artifact@v4
- name: Show artifacts
run: tree
- name: Upload artifacts
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: twine upload --non-interactive --verbose
native/*.tar.gz
cross-*/wheelhouse/*.whl