-
Notifications
You must be signed in to change notification settings - Fork 33
80 lines (67 loc) · 2.25 KB
/
linux.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Linux
on:
push:
paths:
- '.github/workflows/linux.yml'
- 'CMakeLists.txt'
- 'src/**'
- 'test/**'
- 'modules/**'
- '3rdparty/**'
pull_request:
paths:
- '.github/workflows/linux.yml'
- 'CMakeLists.txt'
- 'src/**'
- 'test/**'
- 'modules/**'
- '3rdparty/**'
release:
types: published
jobs:
build:
strategy:
fail-fast: false
matrix:
compiler: [gcc, clang]
config: [Release, Debug]
image: [ubuntu-22.04]
runs-on: ${{ matrix.image }}
env:
CC: ${{ matrix.compiler == 'gcc' && 'gcc' || 'clang' }}
CXX: ${{ matrix.compiler == 'gcc' && 'g++' || 'clang++' }}
CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: recursive
- uses: hendrikmuhs/ccache-action@v1
with:
key: linux-${{ matrix.image }}-${{ matrix.compiler }}-${{ matrix.config }}
- name: Install dependencies
run: |
sudo apt update
# TODO: Better to only install dependencies of these packages instead, except ninja
sudo apt install -y libglfw3-dev libopenal-dev libglvnd-core-dev libsdl2-dev ninja-build
- name: Configure
run: |
cmake -G Ninja -B build -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_LINK_WHAT_YOU_USE=TRUE
- name: Compile Dependencies
run: |
cmake --build build --parallel --config ${{ matrix.config }} --target compile-osp-magnum-deps compile-test-deps
- name: Compile OSP-Magnum
run: |
cmake --build build --parallel --config ${{ matrix.config }} --target osp-magnum
- name: Compile Unit Tests
run: |
cmake --build build --parallel --config ${{ matrix.config }} --target compile-tests
# TODO: Why doesn't the "test" target execute tests?
- name: Run Unit Tests
run: |
ctest --schedule-random --progress --output-on-failure --parallel --no-tests=error --build-config ${{ matrix.config }} --test-dir build
- uses: actions/upload-artifact@v4
with:
name: OSP-linux-${{ matrix.image}}-${{ matrix.config }}-${{ matrix.compiler }}
path: build/${{ matrix.config }}