-
Notifications
You must be signed in to change notification settings - Fork 4
65 lines (55 loc) · 2.12 KB
/
build.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
name: Build
on: [push, pull_request, workflow_dispatch]
jobs:
build:
name: ${{ matrix.os }} - ${{ matrix.buildPreset }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
configurePreset: [ GCC, visual-studio-17-2022 ]
buildPreset: [ msvc-debug, msvc-release, g++-release, g++-debug ]
exclude:
- os: ubuntu-latest
configurePreset: visual-studio-17-2022
- os: ubuntu-latest
buildPreset: msvc-debug
- os: ubuntu-latest
buildPreset: msvc-release
- os: windows-latest
configurePreset: GCC
- os: windows-latest
buildPreset: g++-debug
- os: windows-latest
buildPreset: g++-release
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Dependencies (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt update
sudo apt install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev libgl1-mesa-dev ninja-build -y
- name: Install Dependencies (Windows)
if: matrix.os == 'windows-latest'
run: |
choco install ninja
- name: Configure CMake (non-GCC)
if: matrix.configurePreset != 'GCC'
run: cmake --preset "${{ matrix.configurePreset }}"
- name: Configure CMake (GCC)
if: matrix.configurePreset == 'GCC'
run: cmake --preset "${{ matrix.configurePreset }}" -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
- name: Build
run: cmake --build . --preset "${{ matrix.buildPreset }}"
working-directory: ${{ github.workspace }}
- name: Test (Debug)
if: matrix.buildPreset == 'g++-debug' || matrix.buildPreset == 'msvc-debug'
run: ./Test
working-directory: ${{ github.workspace }}/build/${{ matrix.configurePreset }}/Debug
- name: Test (Release)
if: matrix.buildPreset == 'g++-release' || matrix.buildPreset == 'msvc-release'
run: ./Test
working-directory: ${{ github.workspace }}/build/${{ matrix.configurePreset }}/Release