Skip to content

Commit

Permalink
CI: Various fixes
Browse files Browse the repository at this point in the history
* Update Ubuntu hosts before installing packages
* Drop SDL versions which don't ship configs on Windows
* Pass locally downloaded SDL packages to find_package(PATHS)
  • Loading branch information
nickelpro committed Jun 21, 2023
1 parent 9618b4a commit fc99498
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 16 deletions.
19 changes: 7 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ jobs:

- name: Install system dependencies
run: |
sudo apt install cmake \
sudo apt-get update
sudo apt-get install cmake \
ninja-build \
xvfb \
gnome-desktop-testing \
Expand Down Expand Up @@ -276,19 +277,13 @@ jobs:
fail-fast: false
matrix:
SDL_VERSION: [ 2.24.0, 2.26.0 ]
TTF_VERSION: [ 2.0.18, 2.20.1 ]
IMG_VERSION: [ 2.0.5, 2.6.2 ]
TTF_VERSION: [ 2.20.1 ]
IMG_VERSION: [ 2.6.2 ]
MIX_VERSION: [ 2.6.3 ]
CPP_VERSION: [ 20 ]
include:
- { SDL_VERSION: 2.0.10, TTF_VERSION: 2.0.18, IMG_VERSION: 2.0.5, MIX_VERSION: 2.6.3, CPP_VERSION: 17 }
- { SDL_VERSION: 2.0.12, TTF_VERSION: 2.0.18, IMG_VERSION: 2.0.5, MIX_VERSION: 2.6.3, CPP_VERSION: 17 }
- { SDL_VERSION: 2.0.14, TTF_VERSION: 2.0.18, IMG_VERSION: 2.0.5, MIX_VERSION: 2.6.3, CPP_VERSION: 17 }
- { SDL_VERSION: 2.0.16, TTF_VERSION: 2.0.18, IMG_VERSION: 2.0.5, MIX_VERSION: 2.6.3, CPP_VERSION: 17 }
- { SDL_VERSION: 2.0.18, TTF_VERSION: 2.0.18, IMG_VERSION: 2.0.5, MIX_VERSION: 2.6.3, CPP_VERSION: 17 }
- { SDL_VERSION: 2.0.20, TTF_VERSION: 2.0.18, IMG_VERSION: 2.0.5, MIX_VERSION: 2.6.3, CPP_VERSION: 17 }
- { SDL_VERSION: 2.0.22, TTF_VERSION: 2.0.18, IMG_VERSION: 2.0.5, MIX_VERSION: 2.6.3, CPP_VERSION: 17 }
- { SDL_VERSION: 2.24.0, TTF_VERSION: 2.0.18, IMG_VERSION: 2.0.5, MIX_VERSION: 2.6.3, CPP_VERSION: 20 }
- { SDL_VERSION: 2.24.0, TTF_VERSION: 2.20.1, IMG_VERSION: 2.6.2, MIX_VERSION: 2.6.3, CPP_VERSION: 17 }
- { SDL_VERSION: 2.24.0, TTF_VERSION: 2.20.1, IMG_VERSION: 2.6.2, MIX_VERSION: 2.6.3, CPP_VERSION: 20 }
- { SDL_VERSION: 2.26.0, TTF_VERSION: 2.20.1, IMG_VERSION: 2.6.2, MIX_VERSION: 2.6.3, CPP_VERSION: 23 }
env:
VCPKG_ROOT: ${{github.workspace}}/vcpkg
Expand Down Expand Up @@ -377,4 +372,4 @@ jobs:
- name: Run mocked tests
shell: cmd
working-directory: ./build/test/mocked-tests
run: centurion-mocks
run: centurion-mocks
31 changes: 27 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,33 @@ set(CENTURION_TEST_TARGET centurion-tests)
set(CENTURION_MOCK_TARGET centurion-mocks)

# System dependencies
find_package(SDL2 CONFIG)
find_package(SDL2_image CONFIG)
find_package(SDL2_mixer CONFIG)
find_package(SDL2_ttf CONFIG)
if (DEFINED ENV{SDL2DIR})
file(TO_CMAKE_PATH $ENV{SDL2DIR} SDL2DIR)
find_package(SDL2 CONFIG PATHS ${SDL2DIR})
else ()
find_package(SDL2 CONFIG)
endif ()

if (DEFINED ENV{SDL2IMAGEDIR})
file(TO_CMAKE_PATH $ENV{SDL2IMAGEDIR} SDL2IMAGEDIR)
find_package(SDL2_image CONFIG PATHS ${SDL2IMAGEDIR})
else ()
find_package(SDL2_image CONFIG)
endif ()

if (DEFINED ENV{SDL2MIXERDIR})
file(TO_CMAKE_PATH $ENV{SDL2MIXERDIR} SDL2MIXERDIR)
find_package(SDL2_mixer CONFIG PATHS ${SDL2MIXERDIR})
else ()
find_package(SDL2_mixer CONFIG)
endif ()

if (DEFINED ENV{SDL2TTFDIR})
file(TO_CMAKE_PATH $ENV{SDL2TTFDIR} SDL2TTFDIR)
find_package(SDL2_ttf CONFIG PATHS ${SDL2TTFDIR})
else ()
find_package(SDL2_ttf CONFIG)
endif ()

# CMake Targets
add_library(centurion-headers-only INTERFACE)
Expand Down

0 comments on commit fc99498

Please sign in to comment.