forked from TeeworldsBotLib/TeeworldsBotLib
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (50 loc) · 1.72 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
name: Build
on:
push:
pull_request:
merge_group:
jobs:
build-cmake:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest, windows-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
- os: windows-latest
cmake-args: -A x64
cmake-init-env: CXXFLAGS=/WX LDFLAGS=/WX
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 ..
${{ matrix.cmake-path }}cmake --build . --config Debug ${{ matrix.build-args }}
- name: Build in release mode
run: |
mkdir release
cd release
${{ matrix.cmake-path }}cmake -E env ${{ matrix.cmake-init-env }} ${{ matrix.cmake-path }}cmake ${{ matrix.cmake-args }} -DCMAKE_BUILD_TYPE=Release -Werror=dev ..
${{ matrix.cmake-path }}cmake --build . --config Release ${{ matrix.build-args }}