MyModernCppStarter/.github/workflows/ubuntu.yml
Lars Melchior 8ba41ae49c
Update CPM.cmake and cache dependencies in workflows (#70)
* update CPM.cmake to 0.28.0

* cache CPM.cmake dependencies

* create modules directory if it doesn't exist on windows

* experiment with env variable

* experiment 2

* experiment 3

* use env for all workflows

* make cache keys OS dependent

* replace env.GITHUB_ with github.workspace

* format workflow files

* update cache key

* use unique key for each workflow
2021-01-20 19:00:20 +01:00

41 lines
925 B
YAML

name: Ubuntu
on:
push:
branches:
- master
pull_request:
branches:
- master
env:
CTEST_OUTPUT_ON_FAILURE: 1
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/cache@v2
with:
path: "**/cpm_modules"
key: ${{ github.action }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}
- name: configure
env:
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules
run: cmake -Stest -Bbuild -DENABLE_TEST_COVERAGE=1 -DCMAKE_BUILD_TYPE=Debug
- name: build
run: cmake --build build -j4
- name: test
run: |
cd build
ctest --build-config Debug
- name: collect code coverage
run: bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"