Skip to content

Update test-build.yml #3

Update test-build.yml

Update test-build.yml #3

Workflow file for this run

##############################################################################
# GitHub Actions Workflow to test building AdTree on Windows, Ubuntu, and macOS.
#
# Copyright (C) 2022 Liangliang Nan <[email protected]>
#
# 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 }}