forked from marxin/cvise
-
Notifications
You must be signed in to change notification settings - Fork 0
195 lines (177 loc) · 6.66 KB
/
Copy pathbuild.yml
File metadata and controls
195 lines (177 loc) · 6.66 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
190
191
192
193
194
195
name: Build openSUSE
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch: {}
# Cancel the workflow if a new one is requested for the same PR/branch, but still test all commits on the master branch.
env:
RETRY: 'retry() { "$@" || for i in 1 2 3 4; do echo "retrying..."; sleep 30; "$@" && break; done; }; retry'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master'}}
jobs:
CI:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
# Note: when changing the versions below, update INSTALL.md as well.
llvm: [18, 19, 20, 21]
build-type: [DEBUG]
include:
- llvm: 21
build-type: ASAN
- llvm: 21
build-type: UBSAN
- llvm: 21
build-type: RelWithDebInfo
extra-flags: -flto=auto
- llvm: 21
build-type: RelWithDebInfo
env: CC=clang CXX=clang++
fail-fast: false
container:
image: opensuse/tumbleweed
steps:
- uses: actions/checkout@v6
- name: Setup openSUSE snapshot repository
uses: ./.github/actions/setup-opensuse
- run: |
${{ env.RETRY }} zypper -n install \
binutils clang${{ matrix.llvm }}-devel cmake flex gcc-c++ llvm${{ matrix.llvm }}-devel \
python3-Pebble python3-pytest python3-pytest-mock python3-pytest-subprocess \
unifdef python3-psutil curl git python3-chardet findutils sudo wget python3-pip python3-jsonschema \
python3-msgspec python3-zstandard awk
- run: ${{ env.RETRY }} zypper -n install sqlite-devel python3
- run: ${{ env.RETRY }} pip install --break-system-packages pytest-cov
- uses: rui314/setup-mold@v1
with:
make-default: false
- run: ld --version
- run: nproc
- name: build
run: |
mkdir objdir
cd objdir
${{ matrix.env }} cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DCMAKE_CXX_FLAGS="${{ matrix.extra-flags }}" -DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=mold" -DCMAKE_SHARED_LINKER_FLAGS="-fuse-ld=mold"
make -j`nproc` VERBOSE=1
- name: test
run: pytest
working-directory: objdir
CI-macos:
runs-on: macos-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
- run: ${{ env.RETRY }} brew install llvm
- run: ${{ env.RETRY }} pip install chardet jsonschema msgspec pebble psutil pytest pytest-mock pytest-subprocess zstandard
- run: mkdir objdir
- run: cmake .. -DCMAKE_PREFIX_PATH="/opt/homebrew/opt/llvm" -DCMAKE_C_COMPILER="/opt/homebrew/opt/llvm/bin/clang"
-DCMAKE_CXX_COMPILER="/opt/homebrew/opt/llvm/bin/clang++"
-DCMAKE_EXE_LINKER_FLAGS="-L/opt/homebrew/opt/llvm/lib/c++ -L/opt/homebrew/opt/llvm/lib/unwind -lunwind -Wl,-rpath,/opt/homebrew/opt/llvm/lib/c++"
working-directory: objdir
- run: make -j`sysctl -n hw.physicalcpu` VERBOSE=1
working-directory: objdir
- run: pytest -x -s
working-directory: objdir
CI-python:
runs-on: ubuntu-latest
timeout-minutes: 30
container:
image: ubuntu:latest
strategy:
matrix:
python:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"
- "3.14t"
fail-fast: false
steps:
- uses: actions/checkout@v6
- run: ${{ env.RETRY }} apt-get update
- run: ${{ env.RETRY }} apt-get -qq install -y gcc g++ wget lsb-release software-properties-common gnupg git cmake flex vim unifdef sudo
- run: chown -R $(whoami) /github/home # workaround for "directory ... pip ... is not owned or is not writable by the current user"
- run: rm -rf /__t/Python # workaround for "error when attempting to execute the process ... pip"
- uses: actions/setup-python@v6
with:
python-version: "${{ matrix.python }}"
cache: 'pip'
- run: ${{ env.RETRY }} pip install chardet jsonschema msgspec pebble psutil pytest pytest-mock pytest-subprocess zstandard ${{ join(matrix.extra-deps, ' ') }}
- run: ${{ env.RETRY }} wget https://apt.llvm.org/llvm.sh
- run: chmod +x llvm.sh
- run: ${{ env.RETRY }} ./llvm.sh all
- run: mkdir objdir
- run: cmake ..
working-directory: objdir
- run: make -j`nproc` VERBOSE=1
working-directory: objdir
- run: python -m pytest
working-directory: objdir
ruff:
runs-on: ubuntu-latest
timeout-minutes: 30
container:
image: opensuse/tumbleweed
steps:
- uses: actions/checkout@v6
- name: Setup openSUSE snapshot repository
uses: ./.github/actions/setup-opensuse
- run: ${{ env.RETRY }} zypper -n install python3-pip
- run: ${{ env.RETRY }} pip install --break-system-packages ruff
- run: ruff check
- run: ruff format --diff
pytype:
runs-on: ubuntu-latest
timeout-minutes: 30
container:
image: opensuse/tumbleweed
steps:
- uses: actions/checkout@v6
- name: Setup openSUSE snapshot repository
uses: ./.github/actions/setup-opensuse
- run: ${{ env.RETRY }} zypper -n install binutils clang-devel cmake flex gcc-c++ llvm-devel python312
- name: prepare venv
# Pytype currently only supports Python <=3.12
run: |
python3.12 -m venv ~/venv
source ~/venv/bin/activate
${{ env.RETRY }} pip install chardet jsonschema msgspec pebble psutil pytest pytest-mock pytest-subprocess pytype zstandard
- name: build
run: |
source ~/venv/bin/activate
mkdir objdir
cd objdir
${{ matrix.env }} cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DCMAKE_CXX_FLAGS=${{ matrix.extra-flags }}
make -j`nproc` VERBOSE=1
- name: pytype
run: |
source ~/venv/bin/activate
pytype --keep-going --jobs=auto objdir
pyright:
runs-on: ubuntu-latest
timeout-minutes: 30
container:
image: opensuse/tumbleweed
steps:
- uses: actions/checkout@v6
- name: Setup openSUSE snapshot repository
uses: ./.github/actions/setup-opensuse
- run: |
${{ env.RETRY }} zypper -n install \
binutils clang-devel cmake flex gcc-c++ llvm-devel python3 python3-pyright \
python3-Pebble python3-pytest python3-pytest-mock python3-pytest-subprocess \
unifdef python3-psutil curl git python3-chardet findutils sudo wget python3-jsonschema \
python3-msgspec python3-zstandard
- run: mkdir objdir
- run: cmake ..
working-directory: objdir
- run: make -j`nproc` VERBOSE=1
working-directory: objdir
- run: pyright
working-directory: objdir