-
Notifications
You must be signed in to change notification settings - Fork 39
56 lines (50 loc) · 1.89 KB
/
test-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
##############################################################################
# GitHub Actions Workflow to test building AdTree on Windows, Ubuntu, and macOS.
#
# Copyright (C) 2022 Liangliang Nan <liangliang.nan@gmail.com>
#
# Licensed under GNU LGPL.3, see LICENCE file
##############################################################################
name: Test Build AdTree
on: [push, pull_request]
jobs:
build:
name: "Build on ${{ matrix.platform }} - ${{ matrix.build_type }}"
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
build_type: [Debug, Release]
runs-on: ${{ matrix.platform }}
steps:
# Checkout the code
- uses: actions/checkout@v3
# Install dependencies and build on Ubuntu
- name: Build on Linux
if: runner.os == 'Linux'
run: |
sudo apt-get update || true
sudo apt-get install -y build-essential libglu1-mesa-dev \
mesa-common-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libboost-all-dev
mkdir -p build && cd build
cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ..
make
# Install dependencies and build on macOS
- name: Build on macOS
if: runner.os == 'macOS'
run: |
brew update || true
brew install cmake boost
mkdir -p build && cd build
cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ..
make
# Set up environment and build on Windows
- name: Build on Windows
if: runner.os == 'Windows'
shell: cmd
run: |
choco install boost cmake --installargs '"ADD_CMAKE_TO_PATH=System"'
mkdir build
cd build
cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ..
cmake --build . --config ${{ matrix.build_type }}