Skip to content

Update github actions for CPM #32

Update github actions for CPM

Update github actions for CPM #32

Workflow file for this run

name: CMake
on:
push:
branches:
- develop
pull_request:
branches:
- develop
env:
BUILD_TYPE: RelWithDebInfo
# CPM cache environment variable
CPM_SOURCE_CACHE: "${{ github.workspace }}/.cpm-cache"
jobs:
build:
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'windows-latest', 'macos-latest']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Cache
uses: actions/cache@v2
env:
cache-name: cache-cpm-modules
with:
path: |
${{ env.CPM_SOURCE_CACHE }}
key: ${{ runner.os }}-${{ env.BUILD_TYPE }}-${{ hashFiles('CMakeLists.txt') }}-${{ hashFiles('cmake/CPM.cmake') }}
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}}