Install FreeType if needed #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Ubuntu CI | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: true | |
matrix: | |
os: [ubuntu-24.04] | |
build_type: [Release, Debug] | |
cpp_compiler: [g++, clang++] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set reusable strings | |
id: strings | |
shell: bash | |
run: | | |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" | |
- name: Setup ccache | |
uses: Chocobo1/setup-ccache-action@v1 | |
- name: Set up cache | |
id: cache-cpm | |
uses: actions/cache@v2 | |
with: | |
path: ~/cpm-cache | |
key: ${{ runner.os }}-cpm-${{ hashFiles('**/') }} | |
restore-keys: | | |
${{ runner.os }}-cpm-a | |
# Download GLFW dependencies | |
- name: Setup GLFW deps | |
run: | | |
sudo sed -i 's/^Types: deb$/Types: deb deb-src/' /etc/apt/sources.list.d/ubuntu.sources | |
sudo apt-get update | |
sudo apt-get build-dep glfw3 | |
- name: Configure CMake (GCC) | |
if: ${{ matrix.cpp_compiler == 'g++' }} | |
run: > | |
cmake -B ${{ steps.strings.outputs.build-output-dir }} | |
-DCPM_SOURCE_CACHE=~/cpm-cache | |
-DCMAKE_CXX_COMPILER=g++ | |
-DCMAKE_C_COMPILER=gcc | |
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} | |
-S ${{ github.workspace }} | |
- name: Configure CMake (Clang) | |
if: ${{ matrix.cpp_compiler == 'clang++' }} | |
run: > | |
cmake -B ${{ steps.strings.outputs.build-output-dir }} | |
-DCPM_SOURCE_CACHE=~/cpm-cache | |
-DCMAKE_CXX_COMPILER=clang++ | |
-DCMAKE_C_COMPILER=clang | |
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} | |
-S ${{ github.workspace }} | |
- name: Build | |
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} |