diff options
author | 3gg <3gg@shellblade.net> | 2024-05-04 16:51:29 -0700 |
---|---|---|
committer | 3gg <3gg@shellblade.net> | 2024-05-04 16:51:29 -0700 |
commit | 8222bfe56d4dabe8d92fc4b25ea1b0163b16f3e1 (patch) | |
tree | 763389e42276035ac134d94eb1dc32293b88d807 /src/contrib/SDL-2.30.2/.github/workflows/main.yml |
Initial commit.
Diffstat (limited to 'src/contrib/SDL-2.30.2/.github/workflows/main.yml')
-rw-r--r-- | src/contrib/SDL-2.30.2/.github/workflows/main.yml | 240 |
1 files changed, 240 insertions, 0 deletions
diff --git a/src/contrib/SDL-2.30.2/.github/workflows/main.yml b/src/contrib/SDL-2.30.2/.github/workflows/main.yml new file mode 100644 index 0000000..223d404 --- /dev/null +++ b/src/contrib/SDL-2.30.2/.github/workflows/main.yml | |||
@@ -0,0 +1,240 @@ | |||
1 | name: Build | ||
2 | |||
3 | on: [push, pull_request] | ||
4 | |||
5 | jobs: | ||
6 | Build: | ||
7 | name: ${{ matrix.platform.name }} | ||
8 | runs-on: ${{ matrix.platform.os }} | ||
9 | |||
10 | defaults: | ||
11 | run: | ||
12 | shell: ${{ matrix.platform.shell }} | ||
13 | |||
14 | strategy: | ||
15 | fail-fast: false | ||
16 | matrix: | ||
17 | platform: | ||
18 | - { name: Windows (mingw32), os: windows-latest, shell: 'msys2 {0}', msystem: mingw32, msys-env: mingw-w64-i686 } | ||
19 | - { name: Windows (mingw64), os: windows-latest, shell: 'msys2 {0}', msystem: mingw64, msys-env: mingw-w64-x86_64 } | ||
20 | - { name: Windows (clang32), os: windows-latest, shell: 'msys2 {0}', msystem: clang32, msys-env: mingw-w64-clang-i686 } | ||
21 | - { name: Windows (clang64), os: windows-latest, shell: 'msys2 {0}', msystem: clang64, msys-env: mingw-w64-clang-x86_64 } | ||
22 | - { name: Windows (ucrt64), os: windows-latest, shell: 'msys2 {0}', msystem: ucrt64, msys-env: mingw-w64-ucrt-x86_64 } | ||
23 | - { name: Ubuntu 20.04 (CMake), os: ubuntu-20.04, shell: sh } | ||
24 | - { name: Ubuntu 20.04 (autotools), os: ubuntu-20.04, shell: sh, autotools: true } | ||
25 | - { name: Intel oneAPI (Ubuntu 20.04), os: ubuntu-20.04, shell: bash, artifact: 'SDL-ubuntu20.04-oneapi', intel: true, | ||
26 | source_cmd: 'source /opt/intel/oneapi/setvars.sh; export CC=icx; export CXX=icx;'} | ||
27 | - { name: Intel Compiler (Ubuntu 20.04), os: ubuntu-20.04, shell: bash, artifact: 'SDL-ubuntu20.04-icc', intel: true, cmake: '-DSDL_CLANG_TIDY=OFF', | ||
28 | source_cmd: 'source /opt/intel/oneapi/setvars.sh; export CC=icc; export CXX=icpc; export CFLAGS=-diag-disable=10441; export CXXFLAGS=-diag-disable=10441; '} | ||
29 | |||
30 | - { name: Ubuntu 22.04 (CMake), os: ubuntu-22.04, shell: sh } | ||
31 | - { name: Ubuntu 22.04 (autotools), os: ubuntu-22.04, shell: sh, autotools: true } | ||
32 | - { name: MacOS (CMake), os: macos-latest, shell: sh, cmake: '-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"' } | ||
33 | - { name: MacOS (autotools), os: macos-latest, shell: sh, autotools: true } | ||
34 | |||
35 | steps: | ||
36 | - name: Set up MSYS2 | ||
37 | if: matrix.platform.shell == 'msys2 {0}' | ||
38 | uses: msys2/setup-msys2@v2 | ||
39 | with: | ||
40 | msystem: ${{ matrix.platform.msystem }} | ||
41 | install: >- | ||
42 | ${{ matrix.platform.msys-env }}-cc | ||
43 | ${{ matrix.platform.msys-env }}-cmake | ||
44 | ${{ matrix.platform.msys-env }}-ninja | ||
45 | ${{ matrix.platform.msys-env }}-pkg-config | ||
46 | |||
47 | - name: Setup Linux dependencies | ||
48 | if: runner.os == 'Linux' | ||
49 | run: | | ||
50 | sudo apt-get update | ||
51 | sudo apt-get install build-essential git make autoconf automake libtool \ | ||
52 | pkg-config cmake ninja-build gnome-desktop-testing libasound2-dev libpulse-dev \ | ||
53 | libaudio-dev libjack-dev libsndio-dev libsamplerate0-dev libx11-dev libxext-dev \ | ||
54 | libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev libwayland-dev \ | ||
55 | libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev \ | ||
56 | libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev fcitx-libs-dev | ||
57 | |||
58 | - name: Setup extra Ubuntu 22.04 dependencies | ||
59 | if: matrix.platform.os == 'ubuntu-22.04' | ||
60 | run: | | ||
61 | sudo apt-get install libpipewire-0.3-dev libdecor-0-dev | ||
62 | |||
63 | - name: Setup Macos dependencies | ||
64 | if: runner.os == 'macOS' | ||
65 | run: | | ||
66 | brew install \ | ||
67 | ninja \ | ||
68 | pkg-config | ||
69 | |||
70 | - name: Setup Intel oneAPI | ||
71 | if: matrix.platform.intel | ||
72 | run: | | ||
73 | # Download the key to system keyring | ||
74 | wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \ | ||
75 | | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null | ||
76 | |||
77 | # Add signed entry to apt sources and configure the APT client to use Intel repository: | ||
78 | echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list | ||
79 | |||
80 | # Update package list | ||
81 | sudo apt-get update -y | ||
82 | |||
83 | # Install oneAPI | ||
84 | sudo apt-get install -y intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic | ||
85 | |||
86 | - uses: actions/checkout@v4 | ||
87 | - name: Check that versioning is consistent | ||
88 | # We only need to run this once: arbitrarily use the Linux/CMake build | ||
89 | if: "runner.os == 'Linux' && ! matrix.platform.autotools" | ||
90 | run: ./build-scripts/test-versioning.sh | ||
91 | - name: Configure (CMake) | ||
92 | if: "! matrix.platform.autotools" | ||
93 | run: | | ||
94 | ${{ matrix.platform.source_cmd }} | ||
95 | cmake -S . -B build -G Ninja \ | ||
96 | -DSDL_TESTS=ON \ | ||
97 | -DSDL_WERROR=ON \ | ||
98 | -DSDL_INSTALL_TESTS=ON \ | ||
99 | -DSDL_VENDOR_INFO="Github Workflow" \ | ||
100 | -DCMAKE_INSTALL_PREFIX=cmake_prefix \ | ||
101 | -DCMAKE_BUILD_TYPE=Release \ | ||
102 | ${{ matrix.platform.cmake }} | ||
103 | - name: Build (CMake) | ||
104 | if: "! matrix.platform.autotools" | ||
105 | run: | | ||
106 | ${{ matrix.platform.source_cmd }} | ||
107 | cmake --build build/ --config Release --verbose --parallel | ||
108 | - name: Run build-time tests (CMake) | ||
109 | if: "! matrix.platform.autotools" | ||
110 | run: | | ||
111 | ${{ matrix.platform.source_cmd }} | ||
112 | set -eu | ||
113 | export SDL_TESTS_QUICK=1 | ||
114 | ctest -VV --test-dir build/ -j2 | ||
115 | if test "${{ runner.os }}" = "Linux"; then | ||
116 | # This should show us the SDL_REVISION | ||
117 | strings build/libSDL2-2.0.so.0 | grep SDL- | ||
118 | fi | ||
119 | - name: Install (CMake) | ||
120 | if: "! matrix.platform.autotools" | ||
121 | run: | | ||
122 | set -eu | ||
123 | cmake --install build/ --config Release | ||
124 | echo "SDL2_DIR=$(pwd)/cmake_prefix" >> $GITHUB_ENV | ||
125 | ( cd cmake_prefix; find ) | LC_ALL=C sort -u | ||
126 | - name: Configure (Autotools) | ||
127 | if: matrix.platform.autotools | ||
128 | run: | | ||
129 | ${{ matrix.platform.source_cmd }} | ||
130 | set -eu | ||
131 | rm -fr build-autotools | ||
132 | mkdir build-autotools | ||
133 | ./autogen.sh | ||
134 | ( | ||
135 | cd build-autotools | ||
136 | ${{ github.workspace }}/configure \ | ||
137 | --enable-vendor-info="Github Workflow" \ | ||
138 | --enable-werror \ | ||
139 | --prefix=${{ github.workspace }}/autotools_prefix \ | ||
140 | ) | ||
141 | if test "${{ runner.os }}" != "macOS" ; then | ||
142 | curdir="$(pwd)" | ||
143 | multiarch="$(dpkg-architecture -qDEB_HOST_MULTIARCH)" | ||
144 | ( | ||
145 | mkdir -p build-autotools/test | ||
146 | cd build-autotools/test | ||
147 | ${{ github.workspace }}/test/configure \ | ||
148 | --enable-werror \ | ||
149 | --x-includes=/usr/include \ | ||
150 | --x-libraries="/usr/lib/${multiarch}" \ | ||
151 | --prefix=${{ github.workspace }}/autotools_prefix \ | ||
152 | SDL_CFLAGS="-I${curdir}/include" \ | ||
153 | SDL_LIBS="-L${curdir}/build-autotools/build/.libs -lSDL2" \ | ||
154 | ac_cv_lib_SDL2_ttf_TTF_Init=no \ | ||
155 | ${NULL+} | ||
156 | ) | ||
157 | fi | ||
158 | - name: Build (Autotools) | ||
159 | if: matrix.platform.autotools | ||
160 | run: | | ||
161 | ${{ matrix.platform.source_cmd }} | ||
162 | set -eu | ||
163 | parallel="$(getconf _NPROCESSORS_ONLN)" | ||
164 | make -j"${parallel}" -C build-autotools V=1 | ||
165 | if test "${{ runner.os }}" != "macOS" ; then | ||
166 | make -j"${parallel}" -C build-autotools/test V=1 | ||
167 | fi | ||
168 | - name: Run build-time tests (Autotools) | ||
169 | if: ${{ matrix.platform.autotools && (runner.os != 'macOS') }} | ||
170 | run: | | ||
171 | ${{ matrix.platform.source_cmd }} | ||
172 | set -eu | ||
173 | curdir="$(pwd)" | ||
174 | parallel="$(getconf _NPROCESSORS_ONLN)" | ||
175 | export SDL_TESTS_QUICK=1 | ||
176 | make -j"${parallel}" -C build-autotools/test check LD_LIBRARY_PATH="${curdir}/build-autotools/build/.libs" | ||
177 | if test "${{ runner.os }}" = "Linux"; then | ||
178 | # This should show us the SDL_REVISION | ||
179 | strings "${curdir}/build-autotools/build/.libs/libSDL2-2.0.so.0" | grep SDL- | ||
180 | fi | ||
181 | - name: Install (Autotools) | ||
182 | if: matrix.platform.autotools | ||
183 | run: | | ||
184 | ${{ matrix.platform.source_cmd }} | ||
185 | set -eu | ||
186 | curdir="$(pwd)" | ||
187 | parallel="$(getconf _NPROCESSORS_ONLN)" | ||
188 | make -j"${parallel}" -C build-autotools install V=1 | ||
189 | if test "${{ runner.os }}" != "macOS" ; then | ||
190 | make -j"${parallel}" -C build-autotools/test install V=1 | ||
191 | fi | ||
192 | ( cd autotools_prefix; find . ) | LC_ALL=C sort -u | ||
193 | echo "SDL2_DIR=$(pwd)/autotools_prefix" >> $GITHUB_ENV | ||
194 | - name: Verify CMake configuration files | ||
195 | run: | | ||
196 | ${{ matrix.platform.source_cmd }} | ||
197 | cmake -S cmake/test -B cmake_config_build -G Ninja \ | ||
198 | -DCMAKE_BUILD_TYPE=Release \ | ||
199 | -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} | ||
200 | cmake --build cmake_config_build --verbose | ||
201 | - name: Verify sdl2-config | ||
202 | run: | | ||
203 | ${{ matrix.platform.source_cmd }} | ||
204 | export PATH=${{ env.SDL2_DIR }}/bin:$PATH | ||
205 | cmake/test/test_sdlconfig.sh | ||
206 | - name: Verify sdl2.pc | ||
207 | run: | | ||
208 | ${{ matrix.platform.source_cmd }} | ||
209 | export PKG_CONFIG_PATH=${{ env.SDL2_DIR }}/lib/pkgconfig | ||
210 | cmake/test/test_pkgconfig.sh | ||
211 | - name: Distcheck (Autotools) | ||
212 | if: matrix.platform.autotools | ||
213 | run: | | ||
214 | set -eu | ||
215 | parallel="$(getconf _NPROCESSORS_ONLN)" | ||
216 | make -j"${parallel}" -C build-autotools dist V=1 | ||
217 | # Similar to Automake `make distcheck`: check that the tarball | ||
218 | # release is sufficient to do a new build | ||
219 | mkdir distcheck | ||
220 | tar -C distcheck -zxf build-autotools/SDL2-*.tar.gz | ||
221 | ( cd distcheck/SDL2-* && ./configure ) | ||
222 | make -j"${parallel}" -C distcheck/SDL2-* | ||
223 | - name: Run installed-tests (Autotools) | ||
224 | if: "runner.os == 'Linux' && matrix.platform.autotools" | ||
225 | run: | | ||
226 | ${{ matrix.platform.source_cmd }} | ||
227 | set -eu | ||
228 | parallel="$(getconf _NPROCESSORS_ONLN)" | ||
229 | sudo make -j"${parallel}" -C build-autotools install | ||
230 | sudo make -j"${parallel}" -C build-autotools/test install | ||
231 | export SDL_TESTS_QUICK=1 | ||
232 | # We need to set LD_LIBRARY_PATH because it isn't in the default | ||
233 | # linker search path. We don't need to set XDG_DATA_DIRS for | ||
234 | # ginsttest-runner, because /usr/local/share *is* in the default | ||
235 | # search path for that. | ||
236 | env --chdir=/ \ | ||
237 | LD_LIBRARY_PATH=/usr/local/lib \ | ||
238 | SDL_AUDIODRIVER=dummy \ | ||
239 | SDL_VIDEODRIVER=dummy \ | ||
240 | ginsttest-runner --tap SDL2 | ||