forked from karlstav/cava
-
Notifications
You must be signed in to change notification settings - Fork 3
193 lines (186 loc) · 6.25 KB
/
build-and-test.yml
File metadata and controls
193 lines (186 loc) · 6.25 KB
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
---
name: build-and-test
'on':
push:
pull_request:
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DoozyX/clang-format-lint-action@v0.5
with:
source: .
exclude: ./third_party
extensions: h,c
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libfftw3-dev \
libasound2-dev \
libncursesw5-dev \
libpulse-dev \
libtool \
automake \
autoconf-archive \
libiniparser-dev \
portaudio19-dev \
libsndio-dev \
libsdl2-2.0-0 \
libsdl2-dev \
squeezelite \
pulseaudio \
libpipewire-0.3-dev
- name: Generate configure
run: ./autogen.sh
- name: Run ./configure
run: ./configure
- name: Run make
run: make CFLAGS='-Werror'
# - name: Run make distcheck
# run: make distcheck
- name: Prepare tests
run: |
pulseaudio -D
squeezelite -o pulse -v -m 51:fb:32:f8:e6:9f -z
- name: run non zero test
run: ./cava -p example_files/test_configs/non_zero_test > /dev/null
- name: run pulseaudio test
run: ./cava -p example_files/test_configs/pulse_zero_test > /dev/null
- name: run fifo test
run: ./cava -p example_files/test_configs/fifo_zero_test > /dev/null
- name: run shmem test
run: ./cava -p example_files/test_configs/shmem_zero_test > /dev/null
- name: build cavacore test application
run: gcc -I include -c -g cavacore_test.c
- name: link cavacore test application
run: gcc -o cavacore_test cavacore_test.o cava-cavacore.o -lm -lfftw3
- name: run cavacore test application
run: ./cavacore_test
build-linux-meson:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libfftw3-dev \
libasound2-dev \
libncursesw5-dev \
libpulse-dev \
libtool \
automake \
autoconf-archive \
libiniparser-dev \
portaudio19-dev \
libsndio-dev \
libsdl2-2.0-0 \
libsdl2-dev \
squeezelite \
pulseaudio \
libpipewire-0.3-dev \
meson
- name: Generate configure
run: meson setup -Dcpp_std=c++20 -Dbuild_target=all build
- name: Run make
run: ninja -C build
- name: Prepare tests
run: |
pulseaudio -D
squeezelite -o pulse -v -m 51:fb:32:f8:e6:9f -z
- name: run non zero test
run: ./build/cava -p example_files/test_configs/non_zero_test > /dev/null
- name: run pulseaudio test
run: ./build/cava -p example_files/test_configs/pulse_zero_test > /dev/null
- name: run fifo test
run: ./build/cava -p example_files/test_configs/fifo_zero_test > /dev/null
- name: run shmem test
run: ./build/cava -p example_files/test_configs/shmem_zero_test > /dev/null
- name: build cavacore test application
run: gcc -I include -c -g cavacore_test.c
- name: link cavacore test application
run: gcc -o cavacore_test cavacore_test.o cava-cavacore.o -lm -lfftw3
- name: run cavacore test application
run: ./cavacore_test
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
brew install fftw libtool automake portaudio iniparser sdl2
ln -s /usr/local/bin/glibtoolize /usr/local/bin/libtoolize
- name: Generate configuresdl2
run: |
PATH="/opt/homebrew/opt/libtool/libexec/gnubin:$PATH" ./autogen.sh
- name: Run ./configure
run: |
LDFLAGS="-L/opt/homebrew/lib" \
CPPFLAGS="-I/opt/homebrew/include" \
./configure
- name: Run make
run: make CFLAGS='-Werror'
- name: run non zero test
run: ./cava -p example_files/test_configs/non_zero_test > /dev/null
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Install vcpkg
run: |
git clone https://github.com/microsoft/vcpkg.git
.\vcpkg\bootstrap-vcpkg.bat
- name: Set VCPKG_ROOT
run: |
echo "VCPKG_ROOT=$(pwd)\vcpkg" >> $env:GITHUB_ENV
- name: Install vcpkg dependencies
run: |
cd cava_win
& $env:VCPKG_ROOT\\vcpkg install
cd ..
- name: Run msbuild with vcpkg
run: |
msbuild /p:Configuration=Release /p:VcpkgEnabled=true /p:VcpkgRoot=$env:VCPKG_ROOT /p:VcpkgTriplet=x64-windows cava_win\cava_win.sln
- name: Install WiX Toolset
run: dotnet tool install --global wix --version 6.0.2
- name: Install WiX extensions
run: |
wix extension add WixToolset.UI.wixext/6.0.2
wix extension add WixToolset.Util.wixext/6.0.2
- name: Build MSI installer
run: |
$versionLine = Select-String -Path cava_win\setup.iss -Pattern '^AppVersion=' | Select-Object -First 1
$cavaVersion = $versionLine.Line.Split('=')[1].Trim()
wix build -arch x64 cava_win\cava.wxs -d CavaVersion=$cavaVersion -ext WixToolset.UI.wixext -ext WixToolset.Util.wixext -o cava_win\cava_win_x64_install.msi
- name: Upload MSI artifact
uses: actions/upload-artifact@v4
with:
name: cava-msi
path: cava_win\cava_win_x64_install.msi
build-mingw:
runs-on: windows-latest
strategy:
matrix:
msystem: [ucrt64, clang64]
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v4
- uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.msystem }}
pacboy: cc cmake fftw glew ninja SDL2
- name: Run cmake build
run: |
cmake -B bin
cmake --build bin