forked from TeeworldsBotLib/TeeworldsBotLib
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (45 loc) · 1.42 KB
/
test.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
name: Test
on:
push:
pull_request:
merge_group:
jobs:
test-cmake:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest, ubuntu-20.04]
include:
- os: ubuntu-latest
cmake-init-env: CXXFLAGS=-Werror
- os: ubuntu-20.04
cmake-path: /usr/bin/
cmake-init-env: CXXFLAGS=-Werror
- os: macOS-latest
cmake-init-env: CXXFLAGS=-Werror
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Prepare Linux
if: contains(matrix.os, 'ubuntu')
run: |
sudo apt-get update -y
sudo apt-get install -y pkg-config cmake cmake build-essential
- name: Prepare macOS
if: contains(matrix.os, 'macOS')
run: |
brew update || true
brew install pkg-config cmake || true
sudo rm -rf /Library/Developer/CommandLineTools
- name: Build in debug mode
run: |
mkdir debug
cd debug
${{ matrix.cmake-path }}cmake -E env ${{ matrix.cmake-init-env }} ${{ matrix.cmake-path }}cmake ${{ matrix.cmake-args }} -DCMAKE_BUILD_TYPE=Debug -Werror=dev -DTWBL_DEBUG=ON ..
${{ matrix.cmake-path }}cmake --build . --config Debug ${{ matrix.build-args }}
- name: Run tests in debug mode
run: |
cd debug
${{ matrix.cmake-path }}cmake --build . --target test ${{ matrix.build-args }}