forked from anand-bala/signal-temporal-logic
-
Notifications
You must be signed in to change notification settings - Fork 1
207 lines (197 loc) · 6.41 KB
/
build.yml
File metadata and controls
207 lines (197 loc) · 6.41 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
196
197
198
199
200
201
202
203
204
205
206
name: Build
on:
push:
pull_request:
workflow_dispatch:
inputs:
publish_artifacts:
description: 'Publish artifacts'
required: true
default: false
env:
SCCACHE_DIR: ${{ github.workspace }}/.cache/sccache
jobs:
mac-os:
strategy:
fail-fast: false
matrix:
xcode: ['16', '26']
build_type: [Debug, Release]
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Cache dependencies
uses: actions/cache@v3
env:
cache-name: cache-deps
with:
path: .cache/deps
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/ThirdPartyDeps.cmake') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Cache build
uses: actions/cache@v3
env:
cache-name: cache-build
with:
path: .cache/sccache
key: ${{ runner.os }}-build-${{ env.cache-name }}
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ matrix.xcode }}
- name: Install sccache
run: brew install sccache
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: '3.16.x'
- name: CMake configure
run: cmake -B build
- working-directory: build/
run: cmake --build . --config ${{ matrix.build_type }}
- working-directory: build/
run: ctest -C ${{ matrix.build_type }} --output-on-failure
linux:
strategy:
fail-fast: false
matrix:
compiler:
- g++-12
- g++-13
- clang++-16
- clang++-17
build_type: [ Debug, Release ]
runs-on: ubuntu-latest
env:
CXX: ${{ matrix.compiler }}
steps:
- uses: actions/checkout@v3
- name: Cache dependencies
uses: actions/cache@v3
env:
cache-name: cache-deps
with:
path: .cache/deps
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/ThirdPartyDeps.cmake') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Cache build
uses: actions/cache@v3
env:
cache-name: cache-build
with:
path: .cache/sccache
key: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Install sccache
run: |
curl -SL https://github.com/mozilla/sccache/releases/download/v0.2.15/sccache-v0.2.15-x86_64-unknown-linux-musl.tar.gz | tar xvz --strip-components=1 --wildcards "*/sccache"
chmod +x sccache
- name: Install build tools (gcc)
run: sudo apt update && sudo apt install -y ${{ matrix.compiler }}
if: startsWith(matrix.compiler, 'g++')
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: '3.16.x'
- run: cmake -E make_directory build
- working-directory: build/
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
- working-directory: build/
run: cmake --build .
- working-directory: build/
run: ctest --output-on-failure
windows:
strategy:
fail-fast: false
matrix:
build_type: [Debug, Release]
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
- name: Cache dependencies
uses: actions/cache@v3
env:
cache-name: cache-deps
with:
path: .cache/deps
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/ThirdPartyDeps.cmake') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Cache build
uses: actions/cache@v3
env:
cache-name: cache-build
with:
path: .cache/sccache
key: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Install sccache
run: choco install sccache
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: '3.16.x'
- uses: ilammy/msvc-dev-cmd@v1
- run: cmake -E make_directory build
- working-directory: build/
run: cmake $env:GITHUB_WORKSPACE
- working-directory: build/
run: cmake --build . --config ${{ matrix.build_type }}
- working-directory: build/
run: ctest -C ${{ matrix.build_type }} --output-on-failure
wheels:
strategy:
fail-fast: false
matrix:
platform: [ 'windows-2022', 'ubuntu-latest', 'macos-latest' ]
python-version: [ '311', '312', '313', '314' ]
runs-on: ${{ matrix.platform }}
env:
CIBW_BUILD: >
cp${{ matrix.python-version }}-manylinux_x86_64
cp${{ matrix.python-version }}-macosx_*
cp${{ matrix.python-version }}-win_amd64
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_DEPENDENCY_VERSIONS: latest
CIBW_BUILD_VERBOSITY: 3
MACOSX_DEPLOYMENT_TARGET: '11'
CIBW_ENVIRONMENT: CMAKE_BUILD_TYPE=Release
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
cache: 'pip'
python-version: '3.12'
- name: Install dependencies
run: pip install build twine cibuildwheel~=3.3.0
- uses: ilammy/msvc-dev-cmd@v1
- name: Build wheels
run: python -m cibuildwheel --output-dir ./dist
- name: Run twine check
run: twine check --strict dist/*
- uses: actions/upload-artifact@v4
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') || github.event.inputs.publish_artifacts == 'true'
name: Upload artifact (wheels)
with:
name: wheels-${{ matrix.platform }}-py${{ matrix.python-version }}
path: ./dist/*.whl
publish:
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
needs: [wheels, mac-os, linux, windows]
runs-on: ubuntu-latest
environment: pypi
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheels-*
merge-multiple: true
path: ./dist/
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}