File: ci.yml

package info (click to toggle)
snapcast 0.31.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,012 kB
  • sloc: cpp: 37,729; python: 2,543; sh: 455; makefile: 16
file content (422 lines) | stat: -rw-r--r-- 12,810 bytes parent folder | download | duplicates (2)
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
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
name: CI

on:
  push:
  pull_request:

env:
  BOOST_VERSION: 1_87_0

jobs:
  static-analysis:

    strategy:
      fail-fast: false
      matrix:
        tool:
          - cppcheck

    runs-on: ubuntu-24.04

    steps:
      - uses: actions/checkout@v4
      - name: print environment
        run: env
      - name: dependencies
        run: |
          sudo apt-get update && \
          sudo apt-get install -yq libasound2-dev libsoxr-dev libvorbisidec-dev libvorbis-dev libflac-dev \
          libopus-dev alsa-utils libpulse-dev libavahi-client-dev libssl-dev \
          avahi-daemon ccache expat cppcheck 
      - name: cache boost
        id: cache-boost
        uses: actions/cache@v4
        with:
          path: boost_${{ env.BOOST_VERSION }}
          key: boost-${{ env.BOOST_VERSION }}
          enableCrossOsArchive: true
      - name: get boost
        if: steps.cache-boost.outputs.cache-hit != 'true'
        run: |
          wget https://archives.boost.io/release/${BOOST_VERSION//_/.}/source/boost_${BOOST_VERSION}.tar.bz2
          tar xjf boost_${BOOST_VERSION}.tar.bz2
      - name: configure
        run: |
          cmake -S . -B build \
            -DWERROR=ON -DBUILD_TESTS=OFF \
            -DBOOST_ROOT=boost_${BOOST_VERSION} \
            -DCMAKE_BUILD_TYPE=Release \
            -DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE \
            -DCMAKE_CXX_FLAGS="-DCMAKE_CXX_FLAGS=-DJSON_HAS_CPP_14"
      - name: analysis
        run: cmake --build build --target ${{ matrix.tool }}


  documentation:

    # TODO: Fail in case of (too many) warnings, upload artifacts
    strategy:
      fail-fast: false

    runs-on: ubuntu-24.04

    steps:
      - uses: actions/checkout@v4
      - name: print environment
        run: env
      - name: dependencies
        run: |
          sudo apt-get update && \
          sudo apt-get install -yq libasound2-dev libsoxr-dev libvorbisidec-dev libvorbis-dev libflac-dev \
          libopus-dev alsa-utils libpulse-dev libavahi-client-dev libssl-dev \
          avahi-daemon debhelper ccache expat cppcheck doxygen graphviz
      - name: doxygen
        run: |
          mkdir -p build/doxygen
          doxygen 2>&1 | tee build/doxygen.log
          WARNINGS=$(cat build/doxygen.log | sort | uniq | grep -e ": warning: " | wc -l)
          MAX_ALLOWED=768
          echo "Doxygen finished with $WARNINGS warnings, max allowed: $MAX_ALLOWED"
          if [ "$WARNINGS" -gt "$MAX_ALLOWED" ]; then exit $WARNINGS; else exit 0; fi;


  unit-test:

    strategy:
      fail-fast: false
      matrix:
        sanitizer:
          - asan
          - tsan
        include:
          - sanitizer: asan
            param: "ASAN=ON"
          - sanitizer: tsan
            param: "TSAN=ON"

    runs-on: ubuntu-24.04

    steps:
      - uses: actions/checkout@v4
      - name: print environment
        run: env
      - name: dependencies
        run: |
          sudo apt-get update && \
          sudo apt-get install -yq libasound2-dev libsoxr-dev libvorbisidec-dev libvorbis-dev libflac-dev \
          libopus-dev alsa-utils libpulse-dev libavahi-client-dev libssl-dev \
          avahi-daemon ccache expat catch2
      - name: cache boost
        id: cache-boost
        uses: actions/cache@v4
        with:
          path: boost_${{ env.BOOST_VERSION }}
          key: boost-${{ env.BOOST_VERSION }}
          enableCrossOsArchive: true
      - name: get boost
        if: steps.cache-boost.outputs.cache-hit != 'true'
        run: |
          wget https://archives.boost.io/release/${BOOST_VERSION//_/.}/source/boost_${BOOST_VERSION}.tar.bz2
          tar xjf boost_${BOOST_VERSION}.tar.bz2
      - name: cache ccache
        id: cache-ccache
        uses: actions/cache@v4
        with:
          # TODO: use environment variable $HOME/.ccache
          path: /home/runner/.ccache
          key: ${{ matrix.sanitizer }}-ccache-${{ github.sha }}
          restore-keys: ${{ matrix.sanitizer }}-ccache-
      - name: configure
        run: |
          cmake -S . -B build \
            -DWERROR=ON \
            -DBUILD_TESTS=ON \
            -D${{ matrix.param }} \
            -DBOOST_ROOT=boost_${BOOST_VERSION} \
            -DCMAKE_BUILD_TYPE=Release \
            -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
            -DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE \
            -DCMAKE_CXX_FLAGS="-DCMAKE_CXX_FLAGS=-DJSON_HAS_CPP_14"
      - name: build
        env:
          # TODO: use environment variable $HOME/.ccache
          CCACHE_DIR: /home/runner/.ccache
        run: cmake --build build --parallel 4 --verbose
      - name: unit-test
        run: ./bin/snapcast_test


  linux:

    strategy:
      fail-fast: false
      matrix:
        compiler:
          - clang-10
          - clang-11
          - clang-12
          - clang-13
          - clang-14
          - clang-15
          - clang-16
          - clang-17
          - clang-18
          - gcc-9
          - gcc-10
          - gcc-11
          - gcc-12
          - gcc-13
          - gcc-14
        build_type:
          - Debug
          - Release
        include:
          - compiler: clang-10
            cc: clang-10
            cxx: clang++-10
            os: ubuntu-20.04
          - compiler: clang-11
            cc: clang-11
            cxx: clang++-11
            os: ubuntu-20.04
          - compiler: clang-12
            cc: clang-12
            cxx: clang++-12
            os: ubuntu-20.04
          - compiler: clang-13
            cc: clang-13
            cxx: clang++-13
            os: ubuntu-22.04
          - compiler: clang-14
            cc: clang-14
            cxx: clang++-14
            os: ubuntu-22.04
          - compiler: clang-15
            cc: clang-15
            cxx: clang++-15
            os: ubuntu-22.04
          - compiler: clang-16
            cc: clang-16
            cxx: clang++-16
            os: ubuntu-24.04
          - compiler: clang-17
            cc: clang-17
            cxx: clang++-17
            os: ubuntu-24.04
          - compiler: clang-18
            cc: clang-18
            cxx: clang++-18
            os: ubuntu-24.04
          - compiler: gcc-9
            cc: gcc-9
            cxx: g++-9
            os: ubuntu-22.04
          - compiler: gcc-10
            cc: gcc-10
            cxx: g++-10
            os: ubuntu-22.04
          - compiler: gcc-11
            cc: gcc-11
            cxx: g++-11
            os: ubuntu-22.04
          - compiler: gcc-12
            cc: gcc-12
            cxx: g++-12
            os: ubuntu-22.04
          - compiler: gcc-13
            cc: gcc-13
            cxx: g++-13
            os: ubuntu-24.04
          - compiler: gcc-14
            cc: gcc-14
            cxx: g++-14
            os: ubuntu-24.04

    runs-on: ${{ matrix.os }}

    steps:
      - uses: actions/checkout@v4
      - name: print environment
        run: env
      - name: dependencies
        run: |
          sudo apt-get update && \
          sudo apt-get install -yq libasound2-dev libsoxr-dev libvorbisidec-dev libvorbis-dev libflac-dev \
          libopus-dev alsa-utils libpulse-dev libavahi-client-dev libssl-dev \
          avahi-daemon ccache expat
      - name: cache boost
        id: cache-boost
        uses: actions/cache@v4
        with:
          path: boost_${{ env.BOOST_VERSION }}
          key: boost-${{ env.BOOST_VERSION }}
          enableCrossOsArchive: true
      - name: get boost
        if: steps.cache-boost.outputs.cache-hit != 'true'
        run: |
          wget https://archives.boost.io/release/${BOOST_VERSION//_/.}/source/boost_${BOOST_VERSION}.tar.bz2
          tar xjf boost_${BOOST_VERSION}.tar.bz2
      - name: cache ccache
        id: cache-ccache
        uses: actions/cache@v4
        with:
          # TODO: use environment variable $HOME/.ccache
          path: /home/runner/.ccache
          key: ${{ runner.os }}-${{ matrix.compiler }}-${{ matrix.build_type }}-ccache-${{ github.sha }}
          restore-keys: ${{ runner.os }}-${{ matrix.compiler }}-${{ matrix.build_type }}-ccache-
      #- name: ccache dump config
      #  run: ccache -p
      - name: configure
        run: |
          cmake -S . -B build \
            -DWERROR=ON -DBUILD_TESTS=ON \
            -DBOOST_ROOT=boost_${BOOST_VERSION} \
            -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
            -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
            -DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE \
            -DCMAKE_CXX_FLAGS="-DCMAKE_CXX_FLAGS=-DJSON_HAS_CPP_14"
        env:
          CC: ${{ matrix.cc }}
          CXX: ${{ matrix.cxx }}
      - name: build
        env:
          # TODO: use environment variable $HOME/.ccache
          CCACHE_DIR: /home/runner/.ccache
        run: cmake --build build --parallel 3 --verbose


  macos:

    strategy:
      fail-fast: false
      matrix:
        xcode:
          - "14.1"
          - "14.2"
          - "14.3"
          - "15.0"
          - "15.1"
          - "15.2"
          - "15.3"
          - "15.4"
          - "16.0"
          - "16.1"
          - "16.2"
        build_type:
          - Debug
          - Release
        include:
          - xcode: "14.1"
            os: macos-13
          - xcode: "14.2"
            os: macos-13
          - xcode: "14.3"
            os: macos-13
          - xcode: "15.0"
            os: macos-14
          - xcode: "15.1"
            os: macos-14
          - xcode: "15.2"
            os: macos-14
          - xcode: "15.3"
            os: macos-14
          - xcode: "15.4"
            os: macos-15
          - xcode: "16.0"
            os: macos-15
          - xcode: "16.1"
            os: macos-15
          - xcode: "16.2"
            os: macos-15

    runs-on: ${{ matrix.os }}

    steps:
      - uses: actions/checkout@v4
      - name: print environment
        run: env
      - name: dependencies
        run: |
          brew update
          brew install libsoxr flac libvorbis opus ccache expat catch2
      - name: cache boost
        id: cache-boost
        uses: actions/cache@v4
        with:
          path: boost_${{ env.BOOST_VERSION }}
          key: boost-${{ env.BOOST_VERSION }}
          enableCrossOsArchive: true
      - name: get boost
        if: steps.cache-boost.outputs.cache-hit != 'true'
        run: |
          wget https://archives.boost.io/release/${BOOST_VERSION//_/.}/source/boost_${BOOST_VERSION}.tar.bz2
          tar xjf boost_${BOOST_VERSION}.tar.bz2
      - name: cache ccache
        id: cache-ccache
        uses: actions/cache@v4
        with:
          path: /Users/runner/Library/Caches/ccache
          key: ${{ runner.os }}-${{ matrix.xcode }}-${{ matrix.build_type }}-ccache-${{ github.sha }}
          restore-keys: ${{ runner.os }}-${{ matrix.xcode }}-${{ matrix.build_type }}-ccache-
      - name: configure
        run: |
          cmake -S . -B build \
            -DWERROR=ON -DBUILD_TESTS=ON \
            -DBOOST_ROOT=boost_${BOOST_VERSION} \
            -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
            -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
            -DCMAKE_CXX_FLAGS="-I/usr/local/include -DCMAKE_CXX_FLAGS=-DJSON_HAS_CPP_14"
        env:
          DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
      - name: build
        run: cmake --build build --parallel 3 --verbose


  windows:

    strategy:
      fail-fast: false
      matrix:
        compiler:
          - vs-16
          - vs-17
        build_type:
          - Debug
          - Release
        include:
          - compiler: vs-16
            os: windows-2019
            vs: "Visual Studio 16 2019"
          - compiler: vs-17
            os: windows-2022
            vs: "Visual Studio 17 2022"

    runs-on: ${{ matrix.os }}

    steps:
      - uses: actions/checkout@v4
      - name: cache dependencies
        id: cache-dependencies
        uses: actions/cache@v4
        with:
          #path: ${VCPKG_INSTALLATION_ROOT}\installed
          path: c:\vcpkg\installed
          key: ${{ runner.os }}-dependencies
      - name: dependencies
        if: steps.cache-dependencies.outputs.cache-hit != 'true'
        run: |
          cd c:\vcpkg
          git pull
          vcpkg.exe update
          vcpkg.exe --triplet x64-windows install libflac libvorbis soxr opus boost-asio catch2
      - name: configure
        run: |
          echo vcpkg installation root: ${env:VCPKG_INSTALLATION_ROOT}
          cmake -S . -B build -G "${{ matrix.vs }}" `
            -DWERROR=ON -DBUILD_TESTS=ON `
            -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" `
            -DVCPKG_TARGET_TRIPLET="x64-windows" `
            -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} `
            -DREVISION="${{ github.sha }}"
      - name: build
        run: cmake --build build --parallel 3 --verbose