-
Notifications
You must be signed in to change notification settings - Fork 2
295 lines (282 loc) · 8.92 KB
/
main.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
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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
name: Build ASDF lib and run tests
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
RUST_LOG: info
jobs:
Linux:
runs-on: ubuntu-latest
steps:
- name: Clone Git repository
uses: actions/checkout@v4
with:
submodules: true
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Cache Cargo-installed binaries
uses: actions/cache@v4
id: cache-cargo
with:
path: ~/cargo-bin
# Increment to force re-installation:
key: ${{ runner.os }}-cache01
- name: Install cargo-c
if: steps.cache-cargo.outputs.cache-hit != 'true'
run: |
cargo install cargo-c
mkdir -p ~/cargo-bin
cp ~/.cargo/bin/cargo-capi ~/cargo-bin
cp ~/.cargo/bin/cargo-cbuild ~/cargo-bin
cp ~/.cargo/bin/cargo-cinstall ~/cargo-bin
cp ~/.cargo/bin/cargo-ctest ~/cargo-bin
- name: Add cache directory to path
run: |
echo "$HOME/cargo-bin" >> $GITHUB_PATH
- name: Run tests
run: |
cargo test --workspace --all-features
- name: Install C API
run: |
cargo cinstall --verbose --destdir=temp
sudo cp -r temp/usr/local/* /usr/local/
- name: Update linker path
run: |
sudo ldconfig
- name: Install Pure Data
run: |
sudo apt-get install --no-install-recommends puredata-dev
- name: Build Pure Data external
working-directory: pure-data
run: |
make
make install DESTDIR="$(pwd)" pkglibdir=/pkglibdir
- name: Fix dependencies
working-directory: pure-data
run: |
sh pd-lib-builder-iem-ci/localdeps/localdeps.linux.sh pkglibdir/asdf/asdf~.pd_linux
- name: Upload Pd external
uses: actions/upload-artifact@v4
with:
name: Linux Pd external
path: pure-data/pkglibdir/asdf/*
macOS:
runs-on: macos-latest
steps:
- name: Clone Git repository
uses: actions/checkout@v4
with:
submodules: true
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Cache Cargo-installed binaries
uses: actions/cache@v4
id: cache-cargo
with:
path: ~/cargo-bin
# Increment to force re-installation:
key: ${{ runner.os }}-cache01
- name: Install cargo-c
if: steps.cache-cargo.outputs.cache-hit != 'true'
run: |
cargo install cargo-c
mkdir -p ~/cargo-bin
cp ~/.cargo/bin/cargo-capi ~/cargo-bin
cp ~/.cargo/bin/cargo-cbuild ~/cargo-bin
cp ~/.cargo/bin/cargo-cinstall ~/cargo-bin
cp ~/.cargo/bin/cargo-ctest ~/cargo-bin
- name: Add cache directory to path
run: |
echo "$HOME/cargo-bin" >> $GITHUB_PATH
- name: Run tests
run: |
cargo test --workspace --all-features
- name: Install C API
run: |
cargo cinstall --verbose --destdir=temp
sudo cp -r temp/usr/local/* /usr/local/
- name: Install Pure Data
run: |
brew install --cask pd
PD_APP=$(ls -d /Applications/Pd-*.app)
echo "PDINCLUDEDIR=$PD_APP/Contents/Resources/src" >> $GITHUB_ENV
- name: Build Pure Data external
working-directory: pure-data
run: |
make
make install DESTDIR="$(pwd)" pkglibdir=/pkglibdir
- name: Fix dependencies
working-directory: pure-data
run: |
sh pd-lib-builder-iem-ci/localdeps/localdeps.macos.sh pkglibdir/asdf/asdf~.pd_darwin
- name: Upload Pd external
uses: actions/upload-artifact@v4
with:
name: macOS Pd external
path: pure-data/pkglibdir/asdf/*
Windows-MSYS2:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- name: Install MSYS2
uses: msys2/setup-msys2@v2
with:
update: true
install: >-
make
unzip
mingw-w64-x86_64-cmake
mingw-w64-x86_64-rust
mingw-w64-x86_64-cargo-c
mingw-w64-x86_64-ntldd-git
- name: Clone Git repository
uses: actions/checkout@v4
with:
submodules: true
- name: Run tests
run: |
cargo test --workspace --all-features
- name: Install ASDF
run: |
cargo cinstall --verbose --prefix=/mingw64
- name: Install Pure Data
run: |
wget -q -O Pd.zip http://msp.ucsd.edu/Software/pd-0.51-3.msw.zip
rm -rf "${PROGRAMFILES}/pd" && mkdir -p "${PROGRAMFILES}/pd"
unzip -q Pd.zip -d "${PROGRAMFILES}/pd"
mv -v "${PROGRAMFILES}/pd"/*/* "${PROGRAMFILES}/pd"
rm -f Pd.zip
export PD="${PROGRAMFILES}/pd/bin/pd.com"
- name: Build Pure Data external
working-directory: pure-data
run: |
make
make install DESTDIR="$(pwd)" pkglibdir=/pkglibdir
- name: Fix dll dependencies
working-directory: pure-data
run: |
sh pd-lib-builder-iem-ci/localdeps/localdeps.win.sh pkglibdir/asdf/asdf~.dll
- name: Upload Pd external
uses: actions/upload-artifact@v4
with:
name: Windows Pd external
path: pure-data/pkglibdir/asdf/*
Windows-MSVC:
runs-on: windows-latest
steps:
- name: Clone Git repository
uses: actions/checkout@v4
with:
submodules: true
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable-msvc
- name: Cache Cargo-installed binaries
uses: actions/cache@v4
id: cache-cargo
with:
path: ~/cargo-bin
# Increment to force re-installation:
key: ${{ runner.os }}-cache01
- name: Install cargo-c
if: steps.cache-cargo.outputs.cache-hit != 'true'
run: |
cargo install cargo-c
mkdir -p ~/cargo-bin
cp ~/.cargo/bin/cargo-capi.exe ~/cargo-bin
cp ~/.cargo/bin/cargo-cbuild.exe ~/cargo-bin
cp ~/.cargo/bin/cargo-cinstall.exe ~/cargo-bin
cp ~/.cargo/bin/cargo-ctest.exe ~/cargo-bin
- name: Add cache directory to path
run: |
echo "$HOME\cargo-bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Run tests
run: |
cargo test --workspace --all-features
- name: Install C API
run: |
cargo cinstall --verbose
deken-package:
# The deken package seems to be missing on 22.04:
runs-on: ubuntu-20.04
needs: [Linux, macOS, Windows-MSYS2]
steps:
- name: Clone Git repository
uses: actions/checkout@v4
- name: Retrieve Linux external
uses: actions/download-artifact@v4
with:
name: Linux Pd external
path: asdf
- name: Retrieve macOS external
uses: actions/download-artifact@v4
with:
name: macOS Pd external
path: asdf
- name: Retrieve Windows external
uses: actions/download-artifact@v4
with:
name: Windows Pd external
path: asdf
- name: Copy help patch and source file
run: |
cp pure-data/asdf~* asdf
- name: Install deken
run: |
sudo apt-get install --no-install-recommends deken
# work-arounds from https://github.com/pure-data/deken/issues/247:
mkdir ~/.deken
python3 -m pip install hy==0.19
- name: Run deken
run: |
deken package -v $(git describe --tags --always) --objects pure-data/objects.txt asdf
- name: Upload deken package
uses: actions/upload-artifact@v4
with:
name: Deken package
path: "*.dek*"
check-code:
runs-on: ubuntu-latest
steps:
- name: Clone Git repository
uses: actions/checkout@v4
with:
submodules: true
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: rustfmt, clippy
- name: rustfmt
run: |
cargo fmt --all --check
- name: clippy
run: |
cargo clippy --all-targets --all-features -- -D warnings
- name: Build docs
run: |
cargo rustdoc --all-features -- -D warnings
msrv:
strategy:
matrix:
rust-version: ["1.65.0"]
runs-on: ubuntu-latest
steps:
- name: Clone Git repository
uses: actions/checkout@v4
with:
submodules: true
- name: Install Rust version ${{ matrix.rust-version }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust-version }}
- name: Check whether it compiles
run: |
cargo check --all-features --verbose