-
Notifications
You must be signed in to change notification settings - Fork 0
200 lines (172 loc) · 5.59 KB
/
c.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
name: C
on:
workflow_dispatch:
push:
branches: [ main ]
paths:
- 'demo/c/**'
- '!demo/c/README.md'
- 'project/**'
- '!project/README.md'
- '.github/workflows/c.yml'
pull_request:
branches: [ main, 'v[0-9]+.[0-9]+' ]
paths:
- 'demo/c/**'
- '!demo/c/README.md'
- 'project/**'
- '!project/README.md'
- '.github/workflows/c.yml'
jobs:
build-github-hosted:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
include:
- os: ubuntu-20.04
pv_speaker_platform: linux
output_dir: linux/x86_64
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Create build directory
run: cmake -B ./build -S . -DPV_SPEAKER_PLATFORM="${{ matrix.pv_speaker_platform }}" -DOUTPUT_DIR="${{ matrix.output_dir }}"
working-directory: project
- name: Build
run: cmake --build ./build
working-directory: project
- name: Test
run: ctest --output-on-failure
working-directory: project/build
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.pv_speaker_platform }}
path: |
lib/${{ matrix.output_dir }}/libpv_speaker.*
lib/node/${{ matrix.output_dir }}/pv_speaker.node
retention-days: 3
build-self-hosted:
runs-on: ${{ matrix.machine }}
strategy:
matrix:
machine: [rpi3-32, rpi3-64, rpi4-32, rpi4-64, rpi5-32, rpi5-64]
include:
- machine: rpi3-32
pv_speaker_platform: raspberry-pi3
output_dir: raspberry-pi/cortex-a53
- machine: rpi3-64
pv_speaker_platform: raspberry-pi3-64
output_dir: raspberry-pi/cortex-a53-aarch64
- machine: rpi4-32
pv_speaker_platform: raspberry-pi4
output_dir: raspberry-pi/cortex-a72
- machine: rpi4-64
pv_speaker_platform: raspberry-pi4-64
output_dir: raspberry-pi/cortex-a72-aarch64
- machine: rpi5-32
pv_speaker_platform: raspberry-pi5
output_dir: raspberry-pi/cortex-a76
- machine: rpi5-64
pv_speaker_platform: raspberry-pi5-64
output_dir: raspberry-pi/cortex-a76-aarch64
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Create build directory
run: cmake -B ./build -S . -DPV_SPEAKER_PLATFORM="${{ matrix.pv_speaker_platform }}" -DOUTPUT_DIR="${{ matrix.output_dir }}"
working-directory: project
- name: Build
run: cmake --build ./build
working-directory: project
- name: Test
run: ctest --output-on-failure
working-directory: project/build
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.pv_speaker_platform }}
path: |
lib/${{ matrix.output_dir }}/libpv_speaker.*
lib/node/${{ matrix.output_dir }}/pv_speaker.node
retention-days: 3
build-mac:
runs-on: pv-ios
strategy:
matrix:
pv_speaker_platform: [mac-arm64, mac-x86_64]
include:
- pv_speaker_platform: mac-arm64
output_dir: mac/arm64
- pv_speaker_platform: mac-x86_64
output_dir: mac/x86_64
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Create build directory
run: cmake -B ./build -S . -DPV_SPEAKER_PLATFORM="${{ matrix.pv_speaker_platform }}" -DOUTPUT_DIR="${{ matrix.output_dir }}"
working-directory: project
- name: Build
run: cmake --build ./build
working-directory: project
- name: Test
run: ctest --output-on-failure
working-directory: project/build
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.pv_speaker_platform }}
path: |
lib/${{ matrix.output_dir }}/libpv_speaker.*
lib/node/${{ matrix.output_dir }}/pv_speaker.node
retention-days: 3
build-windows:
runs-on: pv-windows
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Create build directory
run: cmake -B ./build -S . -DPV_SPEAKER_PLATFORM="windows" -DOUTPUT_DIR="windows/amd64"
working-directory: project
shell: pwsh
- name: Build
run: cmake --build ./build
working-directory: project
shell: pwsh
- name: Test
run: ctest --output-on-failure
working-directory: project/build
shell: pwsh
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: windows
path: |
lib/windows/amd64/libpv_speaker.*
lib/node/windows/amd64/pv_speaker.node
retention-days: 3
collect-artifacts:
runs-on: ubuntu-latest
needs: [build-github-hosted, build-self-hosted, build-mac, build-windows]
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Make collection directory
run: mkdir -p all-libs/lib
- name: Collect artifacts
shell: bash
run: |
for DIR in artifacts/*; do cp -a $DIR/* all-libs/lib/; done
- name: Upload all artifacts
uses: actions/upload-artifact@v3
with:
name: all-libs
path: all-libs
retention-days: 3