1- name : Ubuntu Linux (x86_64)
1+ name : Linux
22
33on :
44 push :
5- branches :
5+ branches :
66 - " *"
77 tags :
88 - " *"
9-
9+
1010 pull_request :
11- branches :
11+ branches :
1212 - " *"
1313
1414jobs :
1515 build-shared :
16- name : Shared Library
17- runs-on : ubuntu-latest
16+ name : " Libs: ${{ matrix.libs }}, FS Lib: ${{ matrix.fslib }}, Build OS: ${{ matrix.runs-on }}"
17+ runs-on : ${{ matrix.runs-on }}
18+ strategy :
19+ fail-fast : false
20+ matrix :
21+ libs : ['shared', 'static']
22+ fslib : ['stl', 'boost']
23+ runs-on : ['ubuntu-24.04', 'ubuntu-22.04']
1824
1925 steps :
2026 - uses : actions/checkout@v4
@@ -24,47 +30,41 @@ jobs:
2430 - name : Install Packages
2531 run : |
2632 sudo apt-get update
27- sudo apt-get install -y libgl1-mesa-dev mesa-common-dev libsdl2-dev libglm-dev libgtest-dev libgmock-dev ninja-build
28-
29- - name : Configure Build
30- run : cmake -G "Ninja Multi-Config" -S "${{ github.workspace }}" -B "${{ github.workspace }}/cmake-build" -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/install" -DCMAKE_VERBOSE_MAKEFILE=YES -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=YES
31-
32- - name : Build Debug
33- run : cmake --build "${{ github.workspace }}/cmake-build" --config "Debug" --parallel
34-
35- - name : Run Unit Tests
36- run : ctest --test-dir "${{ github.workspace }}/cmake-build" --verbose --build-config "Debug"
37-
38- - name : Build Release
39- run : cmake --build "${{ github.workspace }}/cmake-build" --config "Release" --parallel
40-
41- - name : Install
33+ sudo apt-get install --yes --no-install-recommends \
34+ libgl1-mesa-dev \
35+ mesa-common-dev \
36+ libsdl2-dev \
37+ libglm-dev \
38+ libgtest-dev \
39+ libgmock-dev \
40+ ninja-build
41+
42+ - name : Install boost-filesystem-dev
43+ if : " ${{ contains(matrix.fslib, 'boost') }}"
4244 run : |
43- cmake --build "${{ github.workspace }}/cmake-build" --config "Debug" --target install
44- cmake --build "${{ github.workspace }}/cmake-build" --config "Release" --target install
45-
46- - name : Upload Artifact
47- uses : actions/upload-artifact@v4
48- with :
49- name : projectm-linux-shared-latest
50- path : install/*
51-
52- build-static :
53- name : Static Library
54- runs-on : ubuntu-latest
55-
56- steps :
57- - uses : actions/checkout@v4
58- with :
59- submodules : ' recursive'
60-
61- - name : Install Packages
62- run : |
63- sudo apt-get update
64- sudo apt-get install -y libgl1-mesa-dev mesa-common-dev libsdl2-dev libglm-dev libgtest-dev libgmock-dev ninja-build
45+ sudo apt-get install --yes --no-install-recommends \
46+ libboost-filesystem-dev
6547
6648 - name : Configure Build
67- run : cmake -G "Ninja Multi-Config" -S "${{ github.workspace }}" -B "${{ github.workspace }}/cmake-build" -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/install" -DCMAKE_VERBOSE_MAKEFILE=YES -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=YES
49+ run : |
50+ if [ "${{ matrix.libs }}" == "shared" ]; then
51+ shared_libs=ON
52+ else
53+ shared_libs=OFF
54+ fi
55+ if [ "${{ matrix.fslib }}" == "boost" ]; then
56+ use_boost=ON
57+ else
58+ use_boost=OFF
59+ fi
60+ cmake -G "Ninja Multi-Config" \
61+ -S "${{ github.workspace }}" \
62+ -B "${{ github.workspace }}/cmake-build" \
63+ -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/install" \
64+ -DCMAKE_VERBOSE_MAKEFILE=YES \
65+ -DBUILD_SHARED_LIBS="${shared_libs}" \
66+ -DENABLE_BOOST_FILESYSTEM="${use_boost}" \
67+ -DBUILD_TESTING=YES
6868
6969 - name : Build Debug
7070 run : cmake --build "${{ github.workspace }}/cmake-build" --config "Debug" --parallel
8383 - name : Upload Artifact
8484 uses : actions/upload-artifact@v4
8585 with :
86- name : projectm-linux-static-latest
87- path : install/*
86+ name : projectm-linux-${{ matrix.libs }}-${{ matrix.fslib }}-${{ matrix.runs-on }}
87+ path : install/*
0 commit comments