Skip to content

WIP: Sdl image

WIP: Sdl image #738

Workflow file for this run

name: Build
on: [push, pull_request]
jobs:
Build:
name: ${{ matrix.platform.name }}
runs-on: ${{ matrix.platform.os }}
strategy:
fail-fast: false
matrix:
platform:
- { name: Windows (mingw32), os: windows-latest, shell: 'msys2 {0}', msystem: mingw32, msys-env: mingw-w64-i686 }
- { name: Windows (mingw64), os: windows-latest, shell: 'msys2 {0}', msystem: mingw64, msys-env: mingw-w64-x86_64 }
- { name: Ubuntu 20.04, os: ubuntu-20.04, shell: sh }
- { name: Ubuntu 22.04, os: ubuntu-22.04, shell: sh }
- { name: MacOS Big Sur, os: macos-12, shell: sh }
defaults:
run:
shell: ${{ matrix.platform.shell }}
steps:
- name: Setup Windows
if: matrix.platform.shell == 'msys2 {0}'
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.platform.msystem }}
install: >-
${{ matrix.platform.msys-env }}-gcc
${{ matrix.platform.msys-env }}-cmake
${{ matrix.platform.msys-env }}-ninja
${{ matrix.platform.msys-env }}-SDL2
${{ matrix.platform.msys-env }}-physfs
${{ matrix.platform.msys-env }}-boost
- name: Setup Linux
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install \
cmake \
libsdl2-dev \
libphysfs-dev \
libboost-test-dev
- name: Setup MacOS
if: runner.os == 'macOS'
run: |
brew install \
sdl2 \
physfs \
boost
- uses: actions/checkout@v2
# Check that blobby builds
- name: Configure CMake and Build
run: |
cmake .
cmake --build .
# On all systems, run the unit tests
- name: Run unit tests
# TODO make it compile on windows too.
if: matrix.platform.shell != 'msys2 {0}'
# configure again to build with test this time.
run: |
cmake . -DBUILD_TESTS=ON
cmake --build .
test/blobbytest
# On linux, we can try to let blobby run in a virtual framebuffer
# The runtest target produces an executable that performs a few actions
# in blobby and then exists
- name: Run Test Scenario
if: runner.os == 'Linux'
run: |
sudo apt-get install xvfb
cmake --build . --target blobby-runtest
xvfb-run src/blobby-runtest