diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 022f7622..596d9773 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,17 +21,13 @@ jobs: sudo apt-get update sudo apt-get install --quiet -y libsdl2-dev libsdl2-ttf-dev sudo apt-get install --quiet -y libsdl2-mixer-dev libsdl2-image-dev - curl -L https://www.libsdl.org/release/SDL2-${SDL2_VERSION}.tar.gz -o SDL2.tar.gz - tar -zxvf SDL2.tar.gz - - - name: Build SDL - run: | - cd SDL2-${SDL2_VERSION} - mkdir build - cd build - ../configure --prefix /tmp/sdl2-${SDL2_VERSION} - make - make install + + - name: Install SDL + - uses: libsdl-org/setup-sdl@main + id: sdl + with: + install-linux-dependencies: true + version: sdl2.0.8 - name: Install V uses: vlang/setup-v@v1 @@ -57,7 +53,6 @@ jobs: - name: Build sdl shared run: | - export CFLAGS="$(/tmp/sdl2-${SDL2_VERSION}/bin/sdl2-config --cflags --libs)" v -shared -g sdl - name: Run tests @@ -66,13 +61,11 @@ jobs: - name: Build sdl examples run: | v shader sdl/examples/sdl_opengl_and_sokol - export CFLAGS="$(/tmp/sdl2-${SDL2_VERSION}/bin/sdl2-config --cflags --libs)" v run sdl/examples/versions v should-compile-all sdl/examples/ - name: Test SDL version run: | - export CFLAGS="$(/tmp/sdl2-${SDL2_VERSION}/bin/sdl2-config --cflags --libs)" VER="$(v run sdl/examples/version)" echo "${SDL2_VERSION} == $VER ?" test "${SDL2_VERSION}" = "$VER" || exit 1 @@ -94,17 +87,12 @@ jobs: - name: Install dependencies run: | brew install sdl2_ttf sdl2_mixer sdl2_image - curl -L https://www.libsdl.org/release/SDL2-${SDL2_VERSION}.tar.gz -o SDL2.tar.gz - tar -zxvf SDL2.tar.gz - - - name: Build SDL - run: | - cd SDL2-${SDL2_VERSION} - mkdir build - cd build - ../configure --prefix /tmp/sdl2-${SDL2_VERSION} - make - make install + + - name: Install SDL + - uses: libsdl-org/setup-sdl@main + id: sdl + with: + version: sdl2.0.8 - name: Checkout SDL uses: actions/checkout@v2 @@ -125,7 +113,6 @@ jobs: - name: Build sdl shared run: | - export CFLAGS="$(/tmp/sdl2-${SDL2_VERSION}/bin/sdl2-config --cflags --libs)" v -shared -g sdl - name: Run tests @@ -134,13 +121,11 @@ jobs: - name: Build sdl examples run: | v shader sdl/examples/sdl_opengl_and_sokol - export CFLAGS="$(/tmp/sdl2-${SDL2_VERSION}/bin/sdl2-config --cflags --libs)" v run sdl/examples/versions v should-compile-all sdl/examples/ - name: Test SDL version run: | - export CFLAGS="$(/tmp/sdl2-${SDL2_VERSION}/bin/sdl2-config --cflags --libs)" VER="$(v run sdl/examples/version)" echo "${SDL2_VERSION} == $VER ?" test "${SDL2_VERSION}" = "$VER" || exit 1