Apple Silicon Support (#39) #114
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
env: | |
CTEST_OUTPUT_ON_FAILURE: ON | |
CTEST_PARALLEL_LEVEL: 2 | |
jobs: | |
#################### | |
# Linux / macOS | |
#################### | |
Unix: | |
name: ${{ matrix.name }} (${{ matrix.config }}) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-20.04, macos-latest] | |
config: [Debug, Release] | |
include: | |
- os: macos-latest | |
name: macOS | |
- os: ubuntu-20.04 | |
name: Linux | |
steps: | |
- name: Checkout repository | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 10 | |
- name: Dependencies (Linux) | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update | |
sudo apt-get install xorg-dev libsuitesparse-dev libblas-dev libglu1-mesa-dev liblapack-dev ccache | |
echo 'CACHE_PATH=~/.cache/ccache' >> "$GITHUB_ENV" | |
- name: Dependencies (macOS) | |
if: runner.os == 'macOS' | |
run: | | |
brew install suite-sparse ccache | |
echo 'CACHE_PATH=~/Library/Caches/ccache' >> "$GITHUB_ENV" | |
- name: Cache Build | |
id: cache-build | |
uses: actions/[email protected] | |
with: | |
path: ${{ env.CACHE_PATH }} | |
key: ${{ runner.os }}-${{ matrix.config }}-cache | |
- name: Prepare ccache | |
run: | | |
ccache --max-size=1.0G | |
ccache -V && ccache --show-config | |
ccache --show-stats && ccache --zero-stats | |
- name: Configure | |
run: | | |
mkdir -p build | |
cd build | |
cmake .. \ | |
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ | |
-DIPC_WITH_EXACT_CCD=ON \ | |
-DCMAKE_BUILD_TYPE=${{ matrix.config }} | |
- name: Build | |
run: cd build; make -j2; ccache --show-stats | |
- name: Tests | |
run: cd build; make test | |
#################### | |
# Windows | |
#################### | |
# Windows: | |
# runs-on: windows-2019 | |
# env: | |
# CC: cl.exe | |
# CXX: cl.exe | |
# strategy: | |
# fail-fast: false | |
# matrix: | |
# config: [Release] | |
# steps: | |
# - name: Checkout repository | |
# uses: actions/checkout@v1 | |
# with: | |
# fetch-depth: 10 | |
# - uses: seanmiddleditch/gha-setup-ninja@master | |
# # https://github.com/actions/cache/issues/101 | |
# - name: Set env | |
# run: | | |
# echo "::set-env name=appdata::$($env:LOCALAPPDATA)" | |
# echo "::set-env name=BOOST_ROOT::$env:BOOST_ROOT_1_69_0" | |
# - name: Cache build | |
# id: cache-build | |
# uses: actions/cache@v1 | |
# with: | |
# path: ${{ env.appdata }}\Mozilla\sccache | |
# key: ${{ runner.os }}-${{ matrix.config }}-cache | |
# - name: Prepare sccache | |
# run: | | |
# Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh') | |
# scoop install sccache --global | |
# # Scoop modifies the PATH so we make the modified PATH global. | |
# echo "::set-env name=PATH::$env:PATH" | |
# # We run configure + build in the same step, since they both need to call VsDevCmd | |
# # Also, cmd uses ^ to break commands into multiple lines (in powershell this is `) | |
# - name: Configure and build | |
# shell: cmd | |
# run: | | |
# call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=x64 | |
# cmake -G Ninja ^ | |
# -DCMAKE_CXX_COMPILER_LAUNCHER=sccache ^ | |
# -DCMAKE_BUILD_TYPE=${{ matrix.config }} ^ | |
# -DIPC_WITH_EXACT_CCD=ON ^ | |
# -B build ^ | |
# -S . | |
# cmake --build build | |
# - name: Tests | |
# run: cd build; ./test/IPC_tests |