ci: release pipeline #9
Workflow file for this run
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 and test | |
on: | |
pull_request: | |
branches: [ "master" ] | |
paths-ignore: | |
- '.github/**' | |
- '.gitignore' | |
- 'README' | |
- 'LICENCE' | |
- '*.gif' | |
- '*.jpeg' | |
- '*.jpg' | |
- '*.jpg' | |
env: | |
BUILD_TYPE: Release | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
commits: | |
name: Conventional Commits | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: webiny/[email protected] | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
compiler: ['clang','msvc','gcc'] | |
os: ['ubuntu-latest', 'windows-latest'] | |
exclude: | |
- os: 'ubuntu-latest' | |
compiler: 'msvc' | |
- os: 'windows-latest' | |
# temporary exclude everything | |
# compiler: 'gcc' | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- 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('**/CMakeLists.txt') }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.compiler }} | |
- name: Prepare environment | |
uses: aminya/setup-cpp@v1 | |
with: | |
compiler: ${{ matrix.compiler }} | |
vcvarsall: ${{ contains(matrix.os, 'windows' )}} | |
cmake: true | |
ninja: true | |
conan: false | |
vcpkg: false | |
ccache: false | |
clangtidy: false | |
cppcheck: false | |
gcovr: false | |
opencppcoverage: false | |
- name: Setup vcpkg and install Boost (Windows) | |
if: steps.cache-step.outputs.cache-hit != 'true' && matrix.os == 'windows-latest' | |
run: | | |
git clone https://github.com/microsoft/vcpkg.git | |
cd vcpkg | |
./bootstrap-vcpkg.bat | |
./vcpkg install boost | |
- name: Get boost | |
if: matrix.os != 'windows-latest' | |
run: sudo apt-get update && sudo apt-get install libboost-program-options-dev | |
- name: Configure CMake (Windows) | |
if: matrix.os == 'windows-latest' | |
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=On -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/vcpkg/scripts/buildsystems/vcpkg.cmake | |
- name: Configure CMake (Windows) | |
if: matrix.os != 'windows-latest' | |
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=On | |
- name: Build | |
run: cmake --build ${{github.workspace}}/build --config Release | |
- name: Test | |
working-directory: ${{ github.workspace }}/build | |
# Exclude LocalLogRepository test as they write to the filesystem | |
run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure -E "LocalLogRepository" | |
static-analysis: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Prepare environment | |
run: sudo apt-get update && sudo apt-get install libboost-program-options-dev clang-tidy | |
- name: Configure CMake | |
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=Off | |
- name: Build | |
run: cmake --build ${{github.workspace}}/build --config Release | |
- name: Static Analysis | |
run: ln -s ./build/compile_commands.json && run-clang-tidy ./source/ | |
code-formatting: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: DoozyX/[email protected] | |
with: | |
source: 'source test' | |
extensions: 'hpp,cpp' | |
clangFormatVersion: 16 |