155 lines
6.7 KiB
YAML
155 lines
6.7 KiB
YAML
name: CI
|
|
on: ['push', 'pull_request']
|
|
|
|
jobs:
|
|
build:
|
|
name: CI
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os:
|
|
- macos-10.15
|
|
- ubuntu-20.04
|
|
compiler:
|
|
- cxx: g++-7
|
|
cc: gcc-7
|
|
macos_cxx: g++-7
|
|
macos_cc: gcc-7
|
|
homebrew_package: gcc@7
|
|
apt_package: g++-7
|
|
- cxx: g++-8
|
|
cc: gcc-8
|
|
macos_cxx: g++-8
|
|
macos_cc: gcc-8
|
|
homebrew_package: gcc@8
|
|
apt_package: g++-8
|
|
- cxx: g++-9
|
|
cc: gcc-9
|
|
macos_cxx: g++-9
|
|
macos_cc: gcc-9
|
|
apt_package: g++-9
|
|
homebrew_package: gcc@9
|
|
# - cxx: g++-10
|
|
# cc: gcc-10
|
|
# macos_cxx: g++-10
|
|
# macos_cc: gcc-10
|
|
# apt_package: g++-10
|
|
# homebrew_package: gcc@10
|
|
- cxx: clang++-7
|
|
cc: clang-7
|
|
macos_cxx: /usr/local/opt/llvm@7/bin/clang++
|
|
macos_cc: /usr/local/opt/llvm@7/bin/clang
|
|
apt_package: clang-7
|
|
homebrew_package: llvm@7
|
|
- cxx: clang++-8
|
|
cc: clang-8
|
|
macos_cxx: /usr/local/opt/llvm@8/bin/clang++
|
|
macos_cc: /usr/local/opt/llvm@8/bin/clang
|
|
apt_package: clang-8
|
|
homebrew_package: llvm@8
|
|
- cxx: clang++-9
|
|
cc: clang-9
|
|
macos_cxx: /usr/local/opt/llvm@9/bin/clang++
|
|
macos_cc: /usr/local/opt/llvm@9/bin/clang
|
|
apt_package: clang-9
|
|
homebrew_package: llvm@9
|
|
# TODO Clang-10 on linux? macos homebrew doesn't seem to have it
|
|
- cxx: clang++-11
|
|
cc: clang-11
|
|
macos_cxx: /usr/local/opt/llvm@11/bin/clang++
|
|
macos_cc: /usr/local/opt/llvm@11/bin/clang
|
|
apt_package: clang-11
|
|
homebrew_package: llvm@11
|
|
# Apple Clang
|
|
# - cxx: clang++
|
|
# cc: clang
|
|
# homebrew_package: ""
|
|
build_type:
|
|
- Debug
|
|
- Release
|
|
- RelWithDebInfo
|
|
runs-on: ${{matrix.os}}
|
|
env:
|
|
# Setting conan cache dir to a location where our Github Cache Action can find it
|
|
CONAN_USER_HOME: "${{ github.workspace }}/conan-cache/"
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v1
|
|
#TODO Ideally, all the setup actions would be in their own subaction, but Github doesn't support using third party actions (e.g. cache) from nested actions yet, see https://github.com/actions/runner/issues/862
|
|
#TODO I disabled pip cache because Github Actions have a limit for total cached data of 5GB and we're above that. Let's rather keep that space for ccache data. TODO Find a way to increase cache size and re-enable the pip cache.
|
|
# - name: Find pip cache location
|
|
# id: pip_cache_dir
|
|
# run: |
|
|
# # We need at least pip 20.1 to get the "pip cache dir" command. Ubuntu doesn't have pip 20.1 by default yet, let's upgrade it
|
|
# python3 -m pip install -U pip
|
|
# python3 -m pip --version
|
|
# echo "::set-output name=pip_cache_dir::$(python3 -m pip cache dir)"
|
|
# shell: bash
|
|
# - name: Setup pip cache
|
|
# uses: actions/cache@v2
|
|
# with:
|
|
# path: ${{ steps.pip_cache_dir.outputs.pip_cache_dir }}
|
|
# key: v0-${{ runner.os }}-setup-pip-${{ github.run_number }}
|
|
# restore-keys: v0-${{ runner.os }}-setup-pip-
|
|
- name: Install OSX dependencies
|
|
if: ${{ runner.os == 'macOS' }}
|
|
shell: bash
|
|
run: |
|
|
brew install ninja macfuse libomp ${{matrix.compiler.homebrew_package}}
|
|
- name: Install Linux dependencies
|
|
if: ${{ runner.os == 'Linux' }}
|
|
shell: bash
|
|
run: |
|
|
sudo apt-get install ninja-build libcurl4-openssl-dev libfuse-dev ${{matrix.compiler.apt_package}}
|
|
- name: Install Conan
|
|
shell: bash
|
|
run: |
|
|
# Using "python3 -m pip" instead of "pip3" to make sure we get the same pip that we queried the cache dir for the Github Cache action
|
|
python3 -m pip install conan
|
|
conan profile new default --detect
|
|
conan profile update settings.compiler.libcxx=libstdc++11 default
|
|
#TODO Ideally, the Setup ccache step would be part of the build action, but Github doesn't support nested actions yet, see https://github.com/actions/runner/issues/862
|
|
- name: Setup ccache
|
|
uses: hendrikmuhs/ccache-action@7a464b8f54f1e1b78e7eb9d0272bc83072959235 # ccache-action@v1.0.3
|
|
with:
|
|
key: "v0-${{ runner.os }}-ccache__${{matrix.os}}__${{matrix.compiler.cxx}}__${{matrix.compiler.cc}}__${{matrix.build_type}}__"
|
|
# TODO We reduced the max cache size from 500M to 200M because GitHub Actions have a maximum for total cached data of 5GB and we're above that.
|
|
# I observed ccache sizes after a clean run to be 130-420MB, so a size of 200MB will only store partial caches for some builds, but it will
|
|
# also not waste much space and keep more cache instances alive within the 5GB limit. TODO Find a better way of handling this, e.g. increase
|
|
# GitHub Action cache space, or at least use ccache --evict-older-than to shrink the cache to its actual size like we do in the macOS builds.
|
|
max-size: 200M
|
|
- name: Configure ccache
|
|
shell: bash
|
|
run: |
|
|
set -v
|
|
ccache --set-config=compiler_check=content
|
|
# TODO Ideally, the Setup conan cache step would be part of the build action, but Github doesn't support nested actions yet, see https://github.com/actions/runner/issues/862
|
|
- name: Setup conan cache
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ${{ env.CONAN_USER_HOME }}
|
|
key: "v0-${{ runner.os }}-conancache__${{matrix.os}}__${{matrix.compiler.cxx}}__${{matrix.compiler.cc}}__${{matrix.build_type}}__-${{ github.run_number }}"
|
|
restore-keys: "v0-${{ runner.os }}-conancache__${{matrix.os}}__${{matrix.compiler.cxx}}__${{matrix.compiler.cc}}__${{matrix.build_type}}__-"
|
|
- name: Build (macOS)
|
|
if: ${{ runner.os == 'macOS' }}
|
|
uses: ./.github/workflows/actions/run_build
|
|
with:
|
|
cxx: ${{ matrix.compiler.macos_cxx }}
|
|
cc: ${{ matrix.compiler.macos_cc }}
|
|
build_type: ${{ matrix.build_type }}
|
|
- name: Build (Linux)
|
|
if: ${{ runner.os == 'Linux' }}
|
|
uses: ./.github/workflows/actions/run_build
|
|
with:
|
|
cxx: ${{ matrix.compiler.cxx }}
|
|
cc: ${{ matrix.compiler.cc }}
|
|
build_type: ${{ matrix.build_type }}
|
|
- name: Test
|
|
uses: ./.github/workflows/actions/run_tests
|
|
- name: Reduce cache size
|
|
if: ${{ runner.os == 'macOS' }}
|
|
shell: bash
|
|
run: |
|
|
set -v
|
|
ccache --evict-older-than 7d
|