⬆️ Updated catch2 to 3.3

This commit is contained in:
2023-02-16 11:41:17 +01:00
parent e39895cf6f
commit d4190e7ba5
10 changed files with 163 additions and 75 deletions

View File

@ -1,21 +1,110 @@
name: Build & Test
on: [ push, pull_request ]
name: Build
on: [push, pull_request]
jobs:
build:
name: Testing on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
build-msvc:
name: Windows
env:
BUILD_TOOLS_PATH: C:\Program Files\Conan\conan
CONAN_USER_HOME_SHORT: None
runs-on: windows-latest
steps:
- run: echo $env:BUILD_TOOLS_PATH | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- uses: actions/checkout@v3
- name: Cache conan
uses: actions/cache@v3.2.5
with:
key: conan-win-${{ hashFiles('conanfile.txt') }}
path: ~/.conan/
- name: Install dependencies
run: choco install conan ninja -y
- name: Enable Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1.12.1
- name: Build
run: |
conan config set storage.download_cache="$env:TMP"
conan install . -b missing -pr:b=tools/conan-profiles/vs-22-release-ninja -pr=tools/conan-profiles/vs-22-release-ninja
cmake . -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake"
ninja
- name: Test
run: ctest -j2 --output-on-failure
- name: Clean Conan pkgs
run: conan remove "*" -fsb
build-gcc:
name: Linux
env:
CONAN_SYSREQUIRES_MODE: "enabled"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache conan
uses: actions/cache@v3.2.5
with:
key: conan-linux-${{ hashFiles('conanfile.txt') }}
path: ~/.conan/
- name: Install dependencies
run: |
sudo apt-get update
curl "https://raw.githubusercontent.com/AnotherFoxGuy/ci-scripts/main/install-cmake.sh" | sudo bash
curl "https://raw.githubusercontent.com/AnotherFoxGuy/ci-scripts/main/install-conan.sh" | sudo bash
sudo apt-get -y install ninja-build
- name: Configure
run: cmake -DBUILD_TEST=ON .
run: |
conan profile new --detect --force default
conan profile update conf.tools.cmake.cmaketoolchain:generator="Ninja" default
conan profile update settings.compiler.libcxx=libstdc++11 default
conan install . -s build_type=Release -b missing -pr:b=default
cmake . -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" -DBUILD_TEST=ON
- name: Build
run: cmake --build .
run: |
ninja
- name: Test
run: ctest -C Debug .
run: ctest -j2 --output-on-failure
- name: Clean Conan pkgs
run: conan remove "*" -fsb
build-appleclang:
name: MacOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Cache conan
uses: actions/cache@v3.2.5
with:
key: conan-mac-${{ hashFiles('conanfile.txt') }}
path: ~/.conan/
- name: Install dependencies
run: brew install conan ninja
- name: Build
run: |
conan profile new --detect --force default
conan profile update conf.tools.cmake.cmaketoolchain:generator="Ninja" default
conan install . -s build_type=Release -b missing -pr:b=default
cmake . -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" -DBUILD_TEST=ON
ninja
shell: bash
- name: Test
run: ctest -j2 --output-on-failure
shell: bash
- name: Clean Conan pkgs
run: conan remove "*" -fsb

View File

@ -5,49 +5,67 @@ on:
- master
- dev
pull_request:
types: [ opened, synchronize, reopened ]
types: [opened, synchronize, reopened]
jobs:
build:
name: sonarcloud scan
runs-on: ubuntu-latest
env:
SONAR_SCANNER_VERSION: 4.7.0.2747
CONAN_SYSREQUIRES_MODE: "enabled"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Install sonar-scanner and build-wrapper
uses: sonarsource/sonarcloud-github-c-cpp@v1
id: sonarscan
- name: Download and set up sonar-scanner
env:
SONAR_SCANNER_DOWNLOAD_URL: https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${{ env.SONAR_SCANNER_VERSION }}-linux.zip
run: |
mkdir -p $HOME/.sonar
curl -sSLo $HOME/.sonar/sonar-scanner.zip ${{ env.SONAR_SCANNER_DOWNLOAD_URL }}
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
wget -nv https://cdn.anotherfoxguy.com/sonar-scanner/mofilereader -O run-sonar-scanner
sudo chmod 777 run-sonar-scanner
echo "$HOME/.sonar/sonar-scanner-${{ env.SONAR_SCANNER_VERSION }}-linux/bin" >> $GITHUB_PATH
- name: Download and set up build-wrapper
env:
BUILD_WRAPPER_DOWNLOAD_URL: https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip
- name: Prepare cfamily cache timestamp
id: cfamily_cache_timestamp
shell: cmake -P {0}
run: |
curl -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip ${{ env.BUILD_WRAPPER_DOWNLOAD_URL }}
unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/
echo "$HOME/.sonar/build-wrapper-linux-x86" >> $GITHUB_PATH
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: cfamily cache files
uses: actions/cache@v3.2.5
with:
path: cfamily-cache
key: cfamily-cache-${{ steps.cfamily_cache_timestamp.outputs.timestamp }}
restore-keys: |
cfamily-cache-
- name: Cache conan
uses: actions/cache@v3.2.5
with:
key: conan-linux-${{ hashFiles('conanfile.txt') }}
path: ~/.conan/
- name: Install dependencies
run: |
curl "https://raw.githubusercontent.com/AnotherFoxGuy/ci-scripts/main/install-cmake.sh" | sudo bash
curl "https://raw.githubusercontent.com/AnotherFoxGuy/ci-scripts/main/install-conan.sh" | sudo bash
- name: Configure
run: cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TEST=ON -DENABLE_COVERAGE=ON .
run: |
conan profile new --detect --force default
conan profile update conf.tools.cmake.cmaketoolchain:generator="Ninja" default
conan profile update settings.compiler.libcxx=libstdc++11 default
conan install . -s build_type=Release -b missing -pr:b=default
cmake . -DCMAKE_BUILD_TYPE=Release -DBUILD_TEST=ON -DENABLE_COVERAGE=ON -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake"
- name: Run build-wrapper
run: build-wrapper-linux-x86-64 --out-dir bw-output make -j4
- name: Test
run: ctest --output-on-failure .
continue-on-error: true
run: ctest -j2 --output-on-failure
- name: Generate coverage
run: make gcov
@ -55,5 +73,8 @@ jobs:
- name: Run sonar-scanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_SCANNER_EXE: /home/runner/.sonar/sonar-scanner-${{ env.SONAR_SCANNER_VERSION }}-linux/bin/sonar-scanner
SONAR_SCANNER_EXE: ${{ steps.sonarscan.outputs.sonar-scanner-binary }}
run: ./run-sonar-scanner
- name: Clean Conan pkgs
run: conan remove "*" -fsb