name: Tests on: [push, pull_request] jobs: windows_msvc_test: name: Windows (MSVC) tests runs-on: windows-latest env: VCPKG_ROOT: C:/vcpkg steps: - name: ๐Ÿ’ณ Checkout uses: actions/checkout@v1 with: fetch-depth: 1 - name: ๐Ÿ’พ Cache dependencies uses: actions/cache@v4 with: path: ${{ env.VCPKG_ROOT }}/installed key: ${{ runner.os }}-vcpkg - name: ๐ŸŒณ Install dependencies run: >- vcpkg install bzip2 freetype[core] libflac libjpeg-turbo libogg libpng libtheora libvorbis libwebp[core] minimp3 openal-soft opus opusfile physfs zlib directxsdk - name: โš™๏ธ Configure static build run: >- cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" -DWANT_DOCS=off -DSHARED=off - name: โš’๏ธ Build static run: cmake --build build --config RelWithDebInfo - name: โš™๏ธ Configure shared Debug build run: >- cmake -B build_shared -S . -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" -DCMAKE_BUILD_TYPE="Debug;RelWithDebInfo" -DWANT_DOCS=off -DWANT_PYTHON_WRAPPER=on - name: โš’๏ธ Build shared run: cmake --build build_shared --config Debug - name: ๐Ÿ Test Python wrapper run: | cp build_shared/python/allegro.py build_shared/lib/Debug/ cd build_shared/lib/Debug python allegro.py windows_msys2_test: name: Windows (MSYS2) tests runs-on: windows-latest steps: - name: ๐Ÿ’ณ Checkout uses: actions/checkout@v1 with: fetch-depth: 1 - name: ๐Ÿšง Setup msys2 uses: msys2/setup-msys2@v2 with: msystem: MINGW64 update: false install: >- mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja make mingw-w64-x86_64-physfs mingw-w64-x86_64-freetype mingw-w64-x86_64-libvorbis mingw-w64-x86_64-flac mingw-w64-x86_64-dumb mingw-w64-x86_64-libtheora mingw-w64-x86_64-libjpeg-turbo mingw-w64-x86_64-opusfile mingw-w64-x86_64-enet mingw-w64-x86_64-libwebp mingw-w64-x86_64-libopenmpt - name: โš™๏ธ Configure shell: msys2 {0} run: cmake -B build -S . -G Ninja -DWANT_PYTHON_WRAPPER=on - name: โš’๏ธ Build shell: msys2 {0} run: cmake --build build - name: ๐Ÿ Test Python wrapper shell: msys2 {0} run: | cp build/python/allegro.py build/lib/ cd build/lib/ python allegro.py osx_test: name: OSX tests runs-on: macos-14 steps: - name: ๐Ÿ’ณ Checkout uses: actions/checkout@v1 with: fetch-depth: 1 - name: ๐Ÿ’พ Cache dependencies uses: actions/cache@v4 with: path: ~/Library/Caches/Homebrew/downloads key: ${{ runner.os }}-brew - name: ๐Ÿšง Setup env: HOMEBREW_NO_AUTO_UPDATE: 1 run: >- brew install opusfile libvorbis freetype flac physfs dumb theora enet libopenmpt - name: โš™๏ธ Configure run: cmake -B build -S . -DWANT_SHADERS_GL=$WANT_SHADERS_GL -G Xcode - name: โš’๏ธ Build run: cmake --build build --config Debug ubuntu_test: name: Ubuntu tests runs-on: ubuntu-latest steps: - name: ๐Ÿ’ณ Checkout uses: actions/checkout@v1 with: fetch-depth: 1 - name: ๐Ÿ’พ Cache test bitmaps uses: actions/cache@v4 with: path: build/tests/*.zip key: bitmaps - name: ๐Ÿšง Setup run: >- sudo apt-get update && sudo apt-get install -qq -y -o=Dpkg::Use-Pty=0 xvfb libvorbis-dev libtheora-dev libwebp-dev libphysfs-dev libopusfile-dev libdumb1-dev libflac-dev libpulse-dev libgtk-3-dev pandoc libcurl4-openssl-dev libenet-dev pulseaudio libasound2-dev libopenal-dev libgl1-mesa-dev libglu-dev libopenmpt-dev - name: โš™๏ธ Configure run: >- cmake -B build -S . -DCMAKE_BUILD_TYPE=Debug -DWANT_SHADERS_GL=on -DWANT_CURL_EXAMPLE=on -DWANT_PYTHON_WRAPPER=on - name: โš’๏ธ Build run: cmake --build build - name: ๐Ÿš€ Run test_driver run: | cd build . ../tests/grab_bitmap_suites.sh find ../tests -name '*.ini' | grep -v 'compressed' | xargs xvfb-run tests/test_driver --save_on_failure --xvfb | tee /tmp/test_out || true mkdir -p test_outputs mv *.png test_outputs grep -q 'failed tests: 0' /tmp/test_out - name: ๐Ÿงช Run other tests run: | cd build make run_standalone_tests - name: ๐Ÿฉบ Upload artifacts if: failure() uses: actions/upload-artifact@v4 with: name: bitmaps path: build/test_outputs - name: ๐Ÿšš Run install_test run: | cd build sudo make install sudo ldconfig 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) pulseaudio -D xvfb-run ./install_test - name: ๐Ÿ Test Python wrapper run: | cd build python python/allegro.py