Skip to content

Build dependencies with CMake #16

Build dependencies with CMake

Build dependencies with CMake #16

Workflow file for this run

name: Build script
on:
# - push
- pull_request
env:
SRC_DIR: ${{ github.workspace }}/src
BUILD_DIR: ${{ github.workspace }}/build
INSTALL_DIR: ${{ github.workspace }}/install
CCACHE_DIR: ${{ github.workspace }}/ccache
CCACHE_MAXSIZE: 10G
jobs:
build_all:
strategy:
matrix:
os:
- ubuntu-22.04
- macos-11
- macos-12
- macos-13
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install dependencies
if: "startsWith(matrix.os, 'ubuntu')"
run: |
sudo apt-get update
sudo ./install_prereq_ubuntu.sh
sudo apt-get install -y ccache
- name: Install dependencies
if: "startsWith(matrix.os, 'macos')"
run: |
brew install cmake eigen ninja ccache xerces-c pcre glew gl2ps tbb
- name: Cache restore
uses: actions/cache/restore@v3
with:
path: ${{ env.CCACHE_DIR }}
key: builddir-${{ runner.os }}-${{ github.job }}-r1
restore-keys: |
builddir-${{ matrix.os }}-${{ github.job }}-r1
builddir-${{ matrix.os }}-${{ github.job }}-
- name: Build
run: |
ccache -z
export CMAKE_BUILD_PARALLEL_LEVEL=2
cmake -S . -B build \
-DCMAKE_INSTALL_PREFIX=$INSTALL_DIR \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
cmake --build build -- root
ccache -s
- uses: actions/upload-artifact@v3
with:
name: dependencies
path: install
- uses: actions/cache/save@v3
if: always()
with:
path: ${{ env.CCACHE_DIR }}
key: builddir-${{ matrix.os }}-${{ github.job }}-r1