Debian Codegraph @

.github/workflows/continuous-integration.yml

raw
1 name: Tests
2 on: [push, pull_request]
3 jobs:
4 windows_msvc_test:
5 name: Windows (MSVC) tests
6 runs-on: windows-latest
7 env:
8 VCPKG_ROOT: C:/vcpkg
9 steps:
10 - name: ๐Ÿ’ณ Checkout
11 uses: actions/checkout@v1
12 with:
13 fetch-depth: 1
14 - name: ๐Ÿ’พ Cache dependencies
15 uses: actions/cache@v4
16 with:
17 path: ${{ env.VCPKG_ROOT }}/installed
18 key: ${{ runner.os }}-vcpkg
19 - name: ๐ŸŒณ Install dependencies
20 run: >-
21 vcpkg install
22 bzip2
23 freetype[core]
24 libflac
25 libjpeg-turbo
26 libogg
27 libpng
28 libtheora
29 libvorbis
30 libwebp[core]
31 minimp3
32 openal-soft
33 opus
34 opusfile
35 physfs
36 zlib
37 directxsdk
38 - name: โš™๏ธ Configure static build
39 run: >-
40 cmake -B build -S .
41 -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"
42 -DWANT_DOCS=off
43 -DSHARED=off
44 - name: โš’๏ธ Build static
45 run: cmake --build build --config RelWithDebInfo
46 - name: โš™๏ธ Configure shared Debug build
47 run: >-
48 cmake -B build_shared -S .
49 -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"
50 -DCMAKE_BUILD_TYPE="Debug;RelWithDebInfo"
51 -DWANT_DOCS=off
52 -DWANT_PYTHON_WRAPPER=on
53 - name: โš’๏ธ Build shared
54 run: cmake --build build_shared --config Debug
55 - name: ๐Ÿ Test Python wrapper
56 run: |
57 cp build_shared/python/allegro.py build_shared/lib/Debug/
58 cd build_shared/lib/Debug
59 python allegro.py
60 windows_msys2_test:
61 name: Windows (MSYS2) tests
62 runs-on: windows-latest
63 steps:
64 - name: ๐Ÿ’ณ Checkout
65 uses: actions/checkout@v1
66 with:
67 fetch-depth: 1
68 - name: ๐Ÿšง Setup msys2
69 uses: msys2/setup-msys2@v2
70 with:
71 msystem: MINGW64
72 update: false
73 install: >-
74 mingw-w64-x86_64-gcc
75 mingw-w64-x86_64-cmake
76 mingw-w64-x86_64-ninja
77 make
78 mingw-w64-x86_64-physfs
79 mingw-w64-x86_64-freetype
80 mingw-w64-x86_64-libvorbis
81 mingw-w64-x86_64-flac
82 mingw-w64-x86_64-dumb
83 mingw-w64-x86_64-libtheora
84 mingw-w64-x86_64-libjpeg-turbo
85 mingw-w64-x86_64-opusfile
86 mingw-w64-x86_64-enet
87 mingw-w64-x86_64-libwebp
88 mingw-w64-x86_64-libopenmpt
89 - name: โš™๏ธ Configure
90 shell: msys2 {0}
91 run: cmake -B build -S . -G Ninja -DWANT_PYTHON_WRAPPER=on
92 - name: โš’๏ธ Build
93 shell: msys2 {0}
94 run: cmake --build build
95 - name: ๐Ÿ Test Python wrapper
96 shell: msys2 {0}
97 run: |
98 cp build/python/allegro.py build/lib/
99 cd build/lib/
100 python allegro.py
101 osx_test:
102 name: OSX tests
103 runs-on: macos-14
104 steps:
105 - name: ๐Ÿ’ณ Checkout
106 uses: actions/checkout@v1
107 with:
108 fetch-depth: 1
109 - name: ๐Ÿ’พ Cache dependencies
110 uses: actions/cache@v4
111 with:
112 path: ~/Library/Caches/Homebrew/downloads
113 key: ${{ runner.os }}-brew
114 - name: ๐Ÿšง Setup
115 env:
116 HOMEBREW_NO_AUTO_UPDATE: 1
117 run: >-
118 brew install
119 opusfile
120 libvorbis
121 freetype
122 flac
123 physfs
124 dumb
125 theora
126 enet
127 libopenmpt
128 - name: โš™๏ธ Configure
129 run: cmake -B build -S . -DWANT_SHADERS_GL=$WANT_SHADERS_GL -G Xcode
130 - name: โš’๏ธ Build
131 run: cmake --build build --config Debug
132 ubuntu_test:
133 name: Ubuntu tests
134 runs-on: ubuntu-latest
135 steps:
136 - name: ๐Ÿ’ณ Checkout
137 uses: actions/checkout@v1
138 with:
139 fetch-depth: 1
140 - name: ๐Ÿ’พ Cache test bitmaps
141 uses: actions/cache@v4
142 with:
143 path: build/tests/*.zip
144 key: bitmaps
145 - name: ๐Ÿšง Setup
146 run: >-
147 sudo apt-get update &&
148 sudo apt-get install -qq -y -o=Dpkg::Use-Pty=0
149 xvfb
150 libvorbis-dev
151 libtheora-dev
152 libwebp-dev
153 libphysfs-dev
154 libopusfile-dev
155 libdumb1-dev
156 libflac-dev
157 libpulse-dev
158 libgtk-3-dev
159 pandoc
160 libcurl4-openssl-dev
161 libenet-dev
162 pulseaudio
163 libasound2-dev
164 libopenal-dev
165 libgl1-mesa-dev
166 libglu-dev
167 libopenmpt-dev
168 - name: โš™๏ธ Configure
169 run: >-
170 cmake -B build -S .
171 -DCMAKE_BUILD_TYPE=Debug
172 -DWANT_SHADERS_GL=on
173 -DWANT_CURL_EXAMPLE=on
174 -DWANT_PYTHON_WRAPPER=on
175 - name: โš’๏ธ Build
176 run: cmake --build build
177 - name: ๐Ÿš€ Run test_driver
178 run: |
179 cd build
180 . ../tests/grab_bitmap_suites.sh
181 find ../tests -name '*.ini' | grep -v 'compressed' | xargs xvfb-run tests/test_driver --save_on_failure --xvfb | tee /tmp/test_out || true
182 mkdir -p test_outputs
183 mv *.png test_outputs
184 grep -q 'failed tests: 0' /tmp/test_out
185 - name: ๐Ÿงช Run other tests
186 run: |
187 cd build
188 make run_standalone_tests
189 - name: ๐Ÿฉบ Upload artifacts
190 if: failure()
191 uses: actions/upload-artifact@v4
192 with:
193 name: bitmaps
194 path: build/test_outputs
195 - name: ๐Ÿšš Run install_test
196 run: |
197 cd build
198 sudo make install
199 sudo ldconfig
200 gcc ../misc/install_test.c -o install_test $(pkg-config --cflags --libs allegro_image-debug-5 allegro_ttf-debug-5 allegro_acodec-debug-5 allegro_dialog-debug-5 allegro_primitives-debug-5 allegro_video-debug-5)
201 pulseaudio -D
202 xvfb-run ./install_test
203 - name: ๐Ÿ Test Python wrapper
204 run: |
205 cd build
206 python python/allegro.py