-
Notifications
You must be signed in to change notification settings - Fork 0
368 lines (353 loc) · 9.89 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
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
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
name: GitHub CI
on:
push:
pull_request:
workflow_dispatch:
inputs:
hello:
description: hello
required: true
type: boolean
world:
description: world
required: false
type: boolean
greeting:
description: greeting
type: string
default: github actions hello
jobs:
trial-sound:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-12
- macos-14
number:
- 1
include:
- os: macos-12
number: 2
- os: macos-12
number: 3
steps:
- name: Grant microphone access for macos-14
if: matrix.os == 'macos-14'
run: sqlite3 $HOME/Library/Application\ Support/com.apple.TCC/TCC.db "INSERT OR IGNORE INTO access VALUES ('kTCCServiceMicrophone','/usr/local/opt/runner/provisioner/provisioner',1,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1687786159,NULL,NULL,'UNUSED',1687786159);"
- name: Show audio devices
run: system_profiler -json SPAudioDataType || true
- name: List audio plugins
run: ls -l /Library/Audio/Plug-Ins/HAL || true
- name: Install BlackHole-2ch
if: matrix.os == 'macos-12'
run: |
if system_profiler -json SPAudioDataType | jq -er '.SPAudioDataType[]._items == []'; then
brew install blackhole-2ch
system_profiler -json SPAudioDataType || true
ls -l /Library/Audio/Plug-Ins/HAL || true
fi
- name: Test
id: test
run: |
echo "start_dt=$(date +'%F %H:%M:%S')" >> $GITHUB_OUTPUT
cat <<'EOT' > test.swift
import AppKit
if let s = NSSound(named: "Tink") {
if !s.play() {
exit(1)
}
}
EOT
xcrun swiftc -o test.out test.swift
./test.out
- name: Log
if: always()
run: |
log show --no-pager 2>&1 | head -n10 | tee "${{ matrix.os }}-${{ matrix.number }}.log"
log show --start "${{ steps.test.outputs.start_dt }}" --no-pager >>"${{ matrix.os }}-${{ matrix.number }}.log" 2>&1
- name: Upload artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-${{ matrix.number }}-${{ github.run_number }}_${{ github.run_attempt }}-artifact
path: ${{ matrix.os }}-${{ matrix.number }}.log
retention-days: 1
# trial-bufsize:
# runs-on: ${{ matrix.os }}
#
# strategy:
# fail-fast: false
# matrix:
# os:
# - ubuntu-latest
# - macos-13
# - macos-14
#
# steps:
# - name: Checkout
# uses: actions/checkout@v4
#
# - name: Check pipebufsize
# run: python3 pipebufsize.py
#
# - name: Check ptsbufsize
# run: python3 ptsbufsize.py
# trial-docker-buildx:
# runs-on: ubuntu-latest
#
# steps:
# - name: Checkout
# uses: actions/checkout@v4
#
# - name: Setup Docker Buildx
# uses: docker/setup-buildx-action@v3
#
# - name: Preparation
# run: |
# mkdir -p target
# echo hello > target/index.txt
# find -type f -not -path './.*/*' | sort
#
# - name: Build Docker Image
# uses: docker/build-push-action@v5
# with:
# context: .
# push: false
# tags: "buildtest:latest"
# outputs: type=image,oci-mediatypes=true,compression=gzip,compression-level=3,force-compression=true
# trial-multiline:
# runs-on: ubuntu-latest
#
# steps:
# - name: Checkout
# uses: actions/checkout@v4
#
# - name: Multiline variables
# run: |
# echo "MULTILINE=${{
# inputs.hello == 'hello' &&
# inputs.world == 'world'
# }}" >> $GITHUB_ENV
#
# - name: Check greeting
# env:
# GREETING: ${{ inputs.greeting }}
# run: echo "greeting=$(echo "${GREETING}" | sed -e 's/./&-/g')" >> $GITHUB_ENV
#
# - name: Check env
# run: echo "${MULTILINE}"
#
# - name: Multiline input
# uses: ./.github/actions/test
# with:
# jq-input: |
# hello
# world
# github,actions
# trial-deno:
# runs-on: ${{ matrix.os }}
#
# strategy:
# fail-fast: false
# matrix:
# os:
# - ubuntu-latest
# - macos-13
# - macos-14
# - windows-latest
# deno-version:
# - v1.x
# # - "1.27.2"
# # - "1.27.1"
# # - "1.27.0"
#
# steps:
# - name: Setup Deno
# uses: denoland/setup-deno@v1
# with:
# deno-version: ${{ matrix.deno-version }}
#
# - name: Deno.systemMemoryInfo
# run: deno eval 'console.log(Deno.systemMemoryInfo());'
#
# - name: os.cpus
# run: deno eval 'import os from "node:os";console.log(os.cpus());'
# trial-secret:
# runs-on: ubuntu-latest
#
# steps:
# - name: Checkout
# uses: actions/checkout@v4
#
# - name: Set secret to env
# run: echo "MY_SECRET=${{ secrets.SECRET_VALUE }}" >> $GITHUB_ENV
#
# - name: Use env
# uses: ./.github/actions/test
# with:
# example: ${{ env.MY_SECRET }}
#
# trial-gh:
# runs-on: ubuntu-latest
#
# steps:
# - name: Show context
# run: |
# (
# echo "github.event_name=${{ github.event_name }}"
# echo "${{ toJSON(github.event) }}"
# ) || true
#
# - uses: actions/checkout@v4
#
# - name: Commit
# if: github.ref_name == 'master'
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# grep -qv hello dir/sample.txt
# echo hello >> dir/sample.txt
# git config --local user.name 'github-actions[bot]'
# git config --local user.email 'github-actions[bot]@users.noreply.github.com'
# git switch -c trial/gh
# git add dir/sample.txt
# git commit -m 'Add message'
# git push -u origin trial/gh
#
# - name: Create pull request
# if: github.ref_name == 'master'
# id: pull_request
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# cat << EOT > /tmp/message
# ### Test
#
# * message 1
# * message 2
# EOT
# gh pr create --base master --title 'trial: Add message' --body-file /tmp/message | tee /tmp/pull_request
# echo "::set-output name=url::$(cat /tmp/pull_request)"
#
# - name: Merge pull request
# if: github.ref_name == 'master'
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# gh pr merge ${{ steps.pull_request.outputs.url }} --auto --merge --delete-branch
#
# setup:
# runs-on: ubuntu-latest
#
# outputs:
# env: ${{ toJSON(env) }}
# matrix: ${{ steps.matrix.outputs.json }}
#
# env:
# VERSION: v1.0
# URL: https://github.com/
#
# steps:
# - uses: actions/checkout@v4
#
# - name: Matrix
# id: matrix
# uses: ./.github/actions/generate-matrix
# with:
# matrix: |
# compiler:
# - clang
# - gcc
# arch:
# - x86_64
# - arm64
# include:
# - compiler: gcc
# arch: powerpc
# exclude:
# - compiler: gcc
# arch: arm64
#
# prepare:
# needs: setup
#
# if: always()
#
# runs-on: ubuntu-latest
#
# env: ${{ fromJSON(needs.setup.outputs.env) }}
#
# strategy:
# fail-fast: false
# matrix: ${{ fromJSON(needs.setup.outputs.matrix) }}
#
# steps:
# - name: Prepare
# run: |
# ${{ matrix.arch != 'dummy' }} \
# && echo "${{ matrix.compiler }},${{ matrix.arch }}" > artifact-${{ matrix.compiler }}-${{ matrix.arch }}.txt
#
# - uses: actions/upload-artifact@v3
# with:
# name: artifact-${{ matrix.compiler }}-${{ matrix.arch }}
# path: artifact-${{ matrix.compiler }}-${{ matrix.arch }}.txt
#
# trial:
# needs: [setup, prepare]
#
# if: always()
#
# runs-on: ubuntu-latest
#
# env: ${{ fromJSON(needs.setup.outputs.env) }}
#
# strategy:
# fail-fast: false
# matrix: ${{ fromJSON(needs.setup.outputs.matrix) }}
#
# steps:
# - uses: actions/download-artifact@v3
# with:
# name: artifact-${{ matrix.compiler }}-${{ matrix.arch }}
#
# - name: Trial
# run: cat artifact-${{ matrix.compiler }}-${{ matrix.arch }}.txt
#
# cleanup:
# needs: trial
#
# if: always()
#
# runs-on: ubuntu-latest
#
# steps:
# - name: Delete artifacts
# run: |
# headers=( \
# -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
# -H "Accept: application/vnd.github.v3+json" \
# )
# api_url=${{ github.api_url }}/repos/${{ github.repository }}/actions
# curl -s "${headers[@]}" ${api_url}/runs/${{ github.run_id }}/artifacts \
# | jq -r '.artifacts[].id' \
# | xargs -I{} curl -s -X DELETE "${headers[@]}" ${api_url}/artifacts/{}
#
# trial-stdio:
# runs-on: ${{ matrix.os }}
#
# strategy:
# fail-fast: false
# matrix:
# os:
# - macos-latest
# - ubuntu-latest
#
# steps:
# - name: Show stdio
# run: |
# echo 'altscreen on' >screenrc
# screen -dmLU -c screenrc -S show-stdio bash -c 'sleep 3 & lsof -p $!'
# while screen -list 2>/dev/null | grep -qs show-stdio; do sleep 1; done
# cat screenlog.0