Skip to content

Commit

Permalink
ci: use libsdl-org/setup-sdl action
Browse files Browse the repository at this point in the history
  • Loading branch information
larpon committed Aug 5, 2023
1 parent c8ef6a3 commit ff9ddb5
Showing 1 changed file with 13 additions and 28 deletions.
41 changes: 13 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit ff9ddb5

Please sign in to comment.