-
Notifications
You must be signed in to change notification settings - Fork 3
202 lines (187 loc) · 7.54 KB
/
c-cpp.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
name: C/C++ CI
on:
schedule:
- cron: '0 0 * * *'
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Preparation on Linux
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install libpulse-dev
- name: Preparation on Windows
if: runner.os == 'Windows'
uses: microsoft/setup-msbuild@v2
- name: Build libraries
run: |
cmake -B build_debug -DCMAKE_BUILD_TYPE=Debug
cmake --build build_debug --config Debug
cmake -B build_release -DCMAKE_BUILD_TYPE=Release
cmake --build build_release --config Release
- name: Test
run: |
pushd build_debug
ctest -C Debug
popd
pushd build_release
ctest -C Release
popd
- name: Build tools
run: |
pushd tools/srla_codec
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release
popd
pushd tools/srla_player
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release
popd
- name: Build SSE/AVX libraries and tools
if: runner.os == 'Windows' || runner.os == 'Linux'
run: |
cmake -B build_release_sse41 -DCMAKE_BUILD_TYPE=Release -DUSE_SIMD_INTRINSICS=SSE41
cmake --build build_release_sse41 --config Release
cmake -B build_release_avx2 -DCMAKE_BUILD_TYPE=Release -DUSE_SIMD_INTRINSICS=AVX2
cmake --build build_release_avx2 --config Release
pushd build_release_sse41
ctest -C Release
popd
pushd build_release_avx2
ctest -C Release
popd
pushd tools/srla_codec
cmake -B build_sse41 -DCMAKE_BUILD_TYPE=Release -DUSE_SIMD_INTRINSICS=SSE41
cmake --build build_sse41 --config Release
popd
pushd tools/srla_player
cmake -B build_sse41 -DCMAKE_BUILD_TYPE=Release -DUSE_SIMD_INTRINSICS=SSE41
cmake --build build_sse41 --config Release
popd
pushd tools/srla_codec
cmake -B build_avx2 -DCMAKE_BUILD_TYPE=Release -DUSE_SIMD_INTRINSICS=AVX2
cmake --build build_avx2 --config Release
popd
pushd tools/srla_player
cmake -B build_avx2 -DCMAKE_BUILD_TYPE=Release -DUSE_SIMD_INTRINSICS=AVX2
cmake --build build_avx2 --config Release
popd
- name: Create artifacts on Linux platform
if: runner.os == 'Linux'
run: |
ARTIFACT_ROOT=srla_${{ matrix.os }}
mkdir ${ARTIFACT_ROOT}
pushd ${ARTIFACT_ROOT}
mkdir include && mkdir libs && mkdir tools
popd
cp include/*.h ${ARTIFACT_ROOT}/include/
cp build_release/libsrlacodec.a ${ARTIFACT_ROOT}/libs/
cp build_release/libsrladec.a ${ARTIFACT_ROOT}/libs/
cp tools/srla_codec/build/srla ${ARTIFACT_ROOT}/tools/
cp tools/srla_player/build/srlaplayer ${ARTIFACT_ROOT}/tools/
tar -czf ${ARTIFACT_ROOT}.tar.gz ${ARTIFACT_ROOT}
ARTIFACT_ROOT_SSE41=srla_${{ matrix.os }}_sse41
mkdir ${ARTIFACT_ROOT_SSE41}
pushd ${ARTIFACT_ROOT_SSE41}
mkdir include && mkdir libs && mkdir tools
popd
cp include/*.h ${ARTIFACT_ROOT_SSE41}/include/
cp build_release_sse41/libsrlacodec.a ${ARTIFACT_ROOT_SSE41}/libs/
cp build_release_sse41/libsrladec.a ${ARTIFACT_ROOT_SSE41}/libs/
cp tools/srla_codec/build_sse41/srla ${ARTIFACT_ROOT_SSE41}/tools/
cp tools/srla_player/build_sse41/srlaplayer ${ARTIFACT_ROOT_SSE41}/tools/
tar -czf ${ARTIFACT_ROOT_SSE41}.tar.gz ${ARTIFACT_ROOT_SSE41}
ARTIFACT_ROOT_AVX2=srla_${{ matrix.os }}_avx2
mkdir ${ARTIFACT_ROOT_AVX2}
pushd ${ARTIFACT_ROOT_AVX2}
mkdir include && mkdir libs && mkdir tools
popd
cp include/*.h ${ARTIFACT_ROOT_AVX2}/include/
cp build_release_avx2/libsrlacodec.a ${ARTIFACT_ROOT_AVX2}/libs/
cp build_release_avx2/libsrladec.a ${ARTIFACT_ROOT_AVX2}/libs/
cp tools/srla_codec/build_avx2/srla ${ARTIFACT_ROOT_AVX2}/tools/
cp tools/srla_player/build_avx2/srlaplayer ${ARTIFACT_ROOT_AVX2}/tools/
tar -czf ${ARTIFACT_ROOT_AVX2}.tar.gz ${ARTIFACT_ROOT_AVX2}
- name: Create artifacts on macOS platform
if: runner.os == 'macOS'
run: |
ARTIFACT_ROOT=srla_${{ matrix.os }}
mkdir ${ARTIFACT_ROOT}
pushd ${ARTIFACT_ROOT}
mkdir include && mkdir libs && mkdir tools
popd
cp include/*.h ${ARTIFACT_ROOT}/include/
cp build_release/libsrlacodec.a ${ARTIFACT_ROOT}/libs/
cp build_release/libsrladec.a ${ARTIFACT_ROOT}/libs/
cp tools/srla_codec/build/srla ${ARTIFACT_ROOT}/tools/
cp tools/srla_player/build/srlaplayer ${ARTIFACT_ROOT}/tools/
tar -czf ${ARTIFACT_ROOT}.tar.gz ${ARTIFACT_ROOT}
- name: Create artifacts on Windows platform
if: runner.os == 'Windows'
shell: powershell
run: |
$ARTIFACT_ROOT = "srla_${{ matrix.os }}"
mkdir ${ARTIFACT_ROOT}
pushd ${ARTIFACT_ROOT}
mkdir include
mkdir libs
mkdir tools
popd
cp include/*.h ${ARTIFACT_ROOT}/include/
cp build_release/Release/srlacodec.lib ${ARTIFACT_ROOT}/libs/
cp build_release/Release/srladec.lib ${ARTIFACT_ROOT}/libs/
cp tools/srla_codec/build/Release/srla.exe ${ARTIFACT_ROOT}/tools/
cp tools/srla_player/build/Release/srlaplayer.exe ${ARTIFACT_ROOT}/tools/
tar -czf "${ARTIFACT_ROOT}.tar.gz" ${ARTIFACT_ROOT}
$ARTIFACT_ROOT_SSE41 = "srla_${{ matrix.os }}_sse41"
mkdir ${ARTIFACT_ROOT_SSE41}
pushd ${ARTIFACT_ROOT_SSE41}
mkdir include
mkdir libs
mkdir tools
popd
cp include/*.h ${ARTIFACT_ROOT_SSE41}/include/
cp build_release_sse41/Release/srlacodec.lib ${ARTIFACT_ROOT_SSE41}/libs/
cp build_release_sse41/Release/srladec.lib ${ARTIFACT_ROOT_SSE41}/libs/
cp tools/srla_codec/build_sse41/Release/srla.exe ${ARTIFACT_ROOT_SSE41}/tools/
cp tools/srla_player/build_sse41/Release/srlaplayer.exe ${ARTIFACT_ROOT_SSE41}/tools/
tar -czf "${ARTIFACT_ROOT_SSE41}.tar.gz" ${ARTIFACT_ROOT_SSE41}
$ARTIFACT_ROOT_AVX2 = "srla_${{ matrix.os }}_avx2"
mkdir ${ARTIFACT_ROOT_AVX2}
pushd ${ARTIFACT_ROOT_AVX2}
mkdir include
mkdir libs
mkdir tools
popd
cp include/*.h ${ARTIFACT_ROOT_AVX2}/include/
cp build_release_avx2/Release/srlacodec.lib ${ARTIFACT_ROOT_AVX2}/libs/
cp build_release_avx2/Release/srladec.lib ${ARTIFACT_ROOT_AVX2}/libs/
cp tools/srla_codec/build_avx2/Release/srla.exe ${ARTIFACT_ROOT_AVX2}/tools/
cp tools/srla_player/build_avx2/Release/srlaplayer.exe ${ARTIFACT_ROOT_AVX2}/tools/
tar -czf "${ARTIFACT_ROOT_AVX2}.tar.gz" ${ARTIFACT_ROOT_AVX2}
- name: Upload artifacts on macOS platform
if: runner.os == 'macOS'
uses: actions/upload-artifact@v4
with:
name: artifacts_${{ matrix.os }}
path: |
srla_${{ matrix.os }}.tar.gz
- name: Upload artifacts on Linux / Windows platforms
if: runner.os == 'Linux' || runner.os == 'Windows'
uses: actions/upload-artifact@v4
with:
name: artifacts_${{ matrix.os }}
path: |
srla_${{ matrix.os }}.tar.gz
srla_${{ matrix.os }}_sse41.tar.gz
srla_${{ matrix.os }}_avx2.tar.gz