Skip to content

Version 7

Version 7 #71

Workflow file for this run

name: ci
on:
pull_request:
release:
types: [published]
push:
branches:
- main
- develop
- master
jobs:
Test:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ${{ matrix.os }}
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
# Recommendations:
# * support at least 2 operating systems
# * support at least 2 compilers
# * make sure all supported configurations for your project are built
#
# Disable/enable builds in this list to meet the above recommendations
# and your own projects needs
matrix:
os:
- ubuntu-22.04
- macos-11
- windows-2022
compiler:
# you can specify the version after `-` like "llvm-13.0.0".
- llvm
- gcc
CMAKE_GENERATOR:
- "Ninja Multi-Config"
CPACK_GENERATOR:
- ZIP
task:
- build
# TODO: add tests and coverage tasks
- test
#- test:release
#- test:without-sanitizer
#- test:release:without-sanitizer
#- coverage
include:
# Inject GCOV variable for gcc
- compiler: gcc
GCOV: gcov
# Inject GCOV variable for llvm
- compiler: llvm
GCOV: "llvm-cov gcov"
# Only to test non-multiconfig builds
- os: ubuntu-22.04
compiler: gcc-13
CMAKE_GENERATOR: "Unix Makefiles"
GCOV: gcov-13
- os: windows-2022
compiler: msvc
CMAKE_GENERATOR: "Visual Studio 17 2022"
# To exclude a specific job from the matrix (e.g gcc on Windows), you can use this syntax.
# exclude:
# - os: windows-2022
# compiler: gcc
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Cache
uses: actions/cache@v3
with:
path: |
~/vcpkg
./build/vcpkg_installed
${{ env.CONAN_USER_HOME }}
~/.cache/pip
${{ env.HOME }}/.cache/vcpkg/archives
${{ env.XDG_CACHE_HOME }}/vcpkg/archives
${{ env.LOCALAPPDATA }}\vcpkg\archives
${{ env.APPDATA }}\vcpkg\archives
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ hashFiles('./vcpkg.json')}}-${{ matrix.CMAKE_GENERATOR }}-${{ matrix.task }}-${{ hashFiles('**/CMakeLists.txt') }}
restore-keys: |
${{ runner.os }}-${{ matrix.compiler }}-${{ hashFiles('./vcpkg.json') }}-
- name: Setup Cpp
uses: aminya/setup-cpp@v1
with:
compiler: ${{ matrix.compiler }}
vcvarsall: ${{ contains(matrix.os, 'windows' )}}
cmake: true
ninja: true
vcpkg: true
ccache: true
clangtidy: true
task: true
cppcheck: true
gcovr: true
opencppcoverage: true
- name: Initialize CodeQL
if: ${{ contains(matrix.os, 'ubuntu') && contains(matrix.compiler, 'llvm') }}
uses: github/codeql-action/init@v2
with:
languages: "cpp"
- name: Build/Test/Coverage
run: |
task ${{matrix.task}}
env:
CMAKE_GENERATOR: ${{matrix.CMAKE_GENERATOR}}
GCOV: ${{matrix.GCOV}}
- name: Perform CodeQL Analysis
if: ${{ contains(matrix.os, 'ubuntu') && contains(matrix.compiler, 'llvm') }}
uses: github/codeql-action/analyze@v2
- name: Publish to codecov
if: ${{ contains(matrix.task, 'coverage') }}
uses: codecov/codecov-action@v2
with:
flags: ${{ runner.os }}
name: ${{ runner.os }}-coverage
files: ./build/coverage.xml