Add an option to trace EAX property commits
[openal-soft.git] / .github / workflows / ci.yml
blob0b8bb88be34c836587e1059c8755b075029ffcc1
1 name: CI
3 on: [push, pull_request]
5 jobs:
6   build:
7     name: ${{matrix.config.name}}
8     runs-on: ${{matrix.config.os}}
9     strategy:
10       fail-fast: false
11       matrix:
12         config:
13         - {
14             name: "Win32-Release",
15             os: windows-latest,
16             cmake_opts: "-A Win32 \
17               -DALSOFT_TESTS=ON \
18               -DALSOFT_BUILD_ROUTER=ON \
19               -DALSOFT_REQUIRE_WINMM=ON \
20               -DALSOFT_REQUIRE_DSOUND=ON \
21               -DALSOFT_REQUIRE_WASAPI=ON",
22             build_type: "Release"
23           }
24         - {
25             name: "Win32-Debug",
26             os: windows-latest,
27             cmake_opts: "-A Win32 \
28               -DALSOFT_TESTS=ON \
29               -DALSOFT_BUILD_ROUTER=ON \
30               -DALSOFT_REQUIRE_WINMM=ON \
31               -DALSOFT_REQUIRE_DSOUND=ON \
32               -DALSOFT_REQUIRE_WASAPI=ON",
33             build_type: "Debug"
34           }
35         - {
36             name: "Win64-Release",
37             os: windows-latest,
38             cmake_opts: "-A x64 \
39               -DALSOFT_TESTS=ON \
40               -DALSOFT_BUILD_ROUTER=ON \
41               -DALSOFT_REQUIRE_WINMM=ON \
42               -DALSOFT_REQUIRE_DSOUND=ON \
43               -DALSOFT_REQUIRE_WASAPI=ON",
44             build_type: "Release"
45           }
46         - {
47             name: "Win64-Debug",
48             os: windows-latest,
49             cmake_opts: "-A x64 \
50               -DALSOFT_TESTS=ON \
51               -DALSOFT_BUILD_ROUTER=ON \
52               -DALSOFT_REQUIRE_WINMM=ON \
53               -DALSOFT_REQUIRE_DSOUND=ON \
54               -DALSOFT_REQUIRE_WASAPI=ON",
55             build_type: "Debug"
56           }
57         - {
58             name: "Win64-UWP",
59             os: windows-latest,
60             cmake_opts: "-A x64 \
61               -DALSOFT_TESTS=OFF \
62               -DCMAKE_SYSTEM_NAME=WindowsStore \
63               \"-DCMAKE_SYSTEM_VERSION=10.0\" \
64               -DALSOFT_BUILD_ROUTER=ON \
65               -DALSOFT_REQUIRE_WASAPI=ON",
66             build_type: "Release"
67           }
68         - {
69             name: "macOS-Release",
70             os: macos-latest,
71             cmake_opts: "-DALSOFT_REQUIRE_COREAUDIO=ON \
72               -DALSOFT_TESTS=ON",
73             build_type: "Release"
74           }
75         - {
76             name: "iOS-Release",
77             os: macos-latest,
78             cmake_opts: "-GXcode \
79             -DCMAKE_SYSTEM_NAME=iOS \
80             -DALSOFT_REQUIRE_COREAUDIO=ON \
81             -DALSOFT_UTILS=OFF \
82             -DALSOFT_EXAMPLES=OFF \
83             -DALSOFT_TESTS=OFF \
84             -DALSOFT_INSTALL=OFF \
85             \"-DCMAKE_OSX_ARCHITECTURES=arm64\"",
86             build_type: "Release"
87           }
88         - {
89             name: "Linux-Release",
90             os: ubuntu-latest,
91             cmake_opts: "-DALSOFT_REQUIRE_RTKIT=ON \
92               -DALSOFT_REQUIRE_ALSA=ON \
93               -DALSOFT_REQUIRE_OSS=ON \
94               -DALSOFT_REQUIRE_PORTAUDIO=ON \
95               -DALSOFT_REQUIRE_PULSEAUDIO=ON \
96               -DALSOFT_REQUIRE_JACK=ON \
97               -DALSOFT_REQUIRE_PIPEWIRE=ON \
98               -DALSOFT_TESTS=ON",
99             deps_cmdline: "sudo apt update && sudo apt-get install -qq \
100               libpulse-dev \
101               portaudio19-dev \
102               libasound2-dev \
103               libjack-dev \
104               libpipewire-0.3-dev \
105               qtbase5-dev \
106               libdbus-1-dev",
107             build_type: "Release"
108           }
109         - {
110             name: "Android_armeabi-v7a-Release",
111             os: ubuntu-latest,
112             cmake_opts: "-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake \
113             -DALSOFT_EMBED_HRTF_DATA=TRUE \
114             -DALSOFT_REQUIRE_OPENSL=ON",
115             build_type: "Release"
116           }
117         - {
118             name: "Android_arm64-v8a-Release",
119             os: ubuntu-latest,
120             cmake_opts: "-DANDRIOD_ABI=arm64-v8a \
121             -DANDROID_PLATFORM=25 \
122             -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake \
123             -DALSOFT_EMBED_HRTF_DATA=TRUE \
124             -DALSOFT_REQUIRE_OPENSL=ON",
125             build_type: "Release"
126           }
127     steps:
128     - uses: actions/checkout@v4
129       with:
130         fetch-depth: '0'
132     - name: Get current commit tag, short hash, count and date
133       run: |
134         echo "CommitTag=$(git describe --tags --abbrev=0 --match *.*.*)" >> $env:GITHUB_ENV
135         echo "CommitHashShort=$(git rev-parse --short=8 HEAD)" >> $env:GITHUB_ENV
136         echo "CommitCount=$(git rev-list --count $env:GITHUB_REF_NAME)" >> $env:GITHUB_ENV
137         echo "CommitDate=$(git show -s --date=iso-local --format=%cd)" >> $env:GITHUB_ENV
139     - name: Install Dependencies
140       shell: bash
141       run: |
142         if [[ ! -z "${{matrix.config.deps_cmdline}}" ]]; then
143           eval ${{matrix.config.deps_cmdline}}
144         fi
146     - name: Configure
147       shell: bash
148       run: |
149         cmake -B build -DCMAKE_BUILD_TYPE=${{matrix.config.build_type}} ${{matrix.config.cmake_opts}} .
151     - name: Build
152       shell: bash
153       run: |
154         cmake --build build --config ${{matrix.config.build_type}}
156     - name: Test
157       shell: bash
158       run: |
159         cd build
160         ctest
162     - name: Set up Windows artifacts
163       if: ${{ contains(matrix.config.name, 'Win') }}
164       shell: bash
165       run: |
166         cd build
167         mkdir archive
168         mkdir archive/router
169         cp ${{matrix.config.build_type}}/soft_oal.dll archive
170         cp ${{matrix.config.build_type}}/OpenAL32.dll archive/router
172     - name: Set up Android artifacts
173       if: ${{ contains(matrix.config.name, 'Android') }}
174       shell: bash
175       run: |
176         cd build
177         mkdir archive
178         cp ${{github.workspace}}/build/libopenal.so archive/
180     - name: Upload build as a workflow artifact
181       uses: actions/upload-artifact@v4
182       if: ${{ contains(matrix.config.name, 'Win') || contains(matrix.config.name, 'Android') }}
183       with:
184         name: soft_oal-${{matrix.config.name}}
185         path: build/archive
187     outputs:
188       CommitTag: ${{env.CommitTag}}
189       CommitHashShort: ${{env.CommitHashShort}}
190       CommitCount: ${{env.CommitCount}}
191       CommitDate: ${{env.CommitDate}}
193   release:
194     if: github.event_name != 'pull_request'
195     needs: build
196     runs-on: ubuntu-latest
197     steps:
199     - name: Download build artifacts
200       uses: actions/download-artifact@v4.1.7
201       with:
202         path: "build"
203         pattern: "*-Win??-Release"
204         github-token: "${{secrets.GITHUB_TOKEN}}"
206     - name: Set up build folders
207       run: |
208         mkdir -p build/release/OpenALSoft/Documentation
209         mkdir -p build/release/OpenALSoft/Win32
210         mkdir -p build/release/OpenALSoft/Win64
211         echo "${{github.repository}}" >>                                                                              "build/release/OpenALSoft/Documentation/Version.txt"
212         echo "v${{needs.build.outputs.CommitTag}}-${{needs.build.outputs.CommitHashShort}} ${{github.ref_name}}" >>   "build/release/OpenALSoft/Documentation/Version.txt"
213         echo "Commit #${{needs.build.outputs.CommitCount}}" >>                                                        "build/release/OpenALSoft/Documentation/Version.txt"
214         echo "${{needs.build.outputs.CommitDate}}" >>                                                                 "build/release/OpenALSoft/Documentation/Version.txt"
215         curl https://raw.githubusercontent.com/${{github.repository}}/${{github.ref_name}}/README.md               -o "build/release/OpenALSoft/Documentation/ReadMe.txt"
216         curl https://raw.githubusercontent.com/${{github.repository}}/${{github.ref_name}}/ChangeLog               -o "build/release/OpenALSoft/Documentation/ChangeLog.txt"
217         curl https://raw.githubusercontent.com/${{github.repository}}/${{github.ref_name}}/COPYING                 -o "build/release/OpenALSoft/Documentation/License.txt"
218         curl https://raw.githubusercontent.com/${{github.repository}}/${{github.ref_name}}/BSD-3Clause             -o "build/release/OpenALSoft/Documentation/License_BSD-3Clause.txt"
219         curl https://raw.githubusercontent.com/${{github.repository}}/${{github.ref_name}}/alsoftrc.sample         -o "build/release/OpenALSoft/Win32/alsoft.ini"
220         curl https://raw.githubusercontent.com/${{github.repository}}/${{github.ref_name}}/alsoftrc.sample         -o "build/release/OpenALSoft/Win64/alsoft.ini"
221         cp "build/soft_oal-Win32-Release/soft_oal.dll"                                                                "build/release/OpenALSoft/Win32/OpenAL32.dll"
222         cp "build/soft_oal-Win64-Release/soft_oal.dll"                                                                "build/release/OpenALSoft/Win64/OpenAL32.dll"
223         cp -r "build/release/OpenALSoft"                                                                              "build/release/OpenALSoft+HRTF"
224         cp "build/release/OpenALSoft+HRTF/Win32/alsoft.ini"                                                           "build/release/OpenALSoft+HRTF/Documentation/alsoft.ini"
225         curl https://raw.githubusercontent.com/${{github.repository}}/${{github.ref_name}}/configs/HRTF/alsoft.ini -o "build/release/OpenALSoft+HRTF/Win32/alsoft.ini"
226         cp "build/release/OpenALSoft+HRTF/Win32/alsoft.ini"                                                           "build/release/OpenALSoft+HRTF/Win64/alsoft.ini"
228     - name: Compress artifacts
229       run: |
230         cd build/release
231         7z a OpenALSoft.zip      ./OpenALSoft/*
232         7z a OpenALSoft+HRTF.zip ./OpenALSoft+HRTF/*
234     - name: GitHub pre-release
235       uses: "Sweeistaken/sweelease@v1.1"
236       with:
237         repo_token: "${{secrets.GITHUB_TOKEN}}"
238         automatic_release_tag: "latest"
239         prerelease: true
240         title: "OpenAL Soft v${{needs.build.outputs.CommitTag}}-${{needs.build.outputs.CommitHashShort}}"
241         files: "build/release/*"