optimized #65
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: CI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
macos: | |
strategy: | |
fail-fast: false | |
matrix: | |
version: [12, 11] | |
runs-on: macos-${{ matrix.version }} | |
steps: | |
- uses: actions/checkout@main | |
- run: brew update | |
- run: brew install cmake ninja tree | |
- run: echo "VCPKG_ROOT=$HOME/.vcpkg/root" >> "$GITHUB_ENV" | |
- run: echo "PATH=$VCPKG_ROOT:$PATH" >> "$GITHUB_ENV" | |
- run: install -d $VCPKG_ROOT | |
- run: git clone https://github.com/microsoft/vcpkg.git $VCPKG_ROOT | |
- run: cd $VCPKG_ROOT && ./bootstrap-vcpkg.sh | |
- run: vcpkg install curl openssl libyaml libgit2 libarchive libqrencode | |
- run: cmake --version | |
- run: cmake -S . -B build.d -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake -DCMAKE_INSTALL_PREFIX=./output -DBUILD_TESTING=OFF -DCMAKE_COLOR_MAKEFILE=ON -DCMAKE_VERBOSE_MAKEFILE=ON | |
- run: cmake --build build.d | |
- run: cmake --install build.d | |
- run: tree output | |
ubuntu: | |
strategy: | |
fail-fast: false | |
matrix: | |
tag: [20.04, 22.04] | |
runs-on: ubuntu-latest | |
container: ubuntu:${{ matrix.tag }} | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
TZ: Europe/London | |
steps: | |
- uses: actions/checkout@main | |
- run: apt -y update | |
- run: apt -y install pkg-config g++ linux-headers-generic cmake ninja-build tree git curl zip unzip tar | |
- run: echo "VCPKG_ROOT=$HOME/.vcpkg/root" >> "$GITHUB_ENV" | |
- run: echo "PATH=$VCPKG_ROOT:$PATH" >> "$GITHUB_ENV" | |
- run: install -d $VCPKG_ROOT | |
- run: git clone https://github.com/microsoft/vcpkg.git $VCPKG_ROOT | |
- run: cd $VCPKG_ROOT && ./bootstrap-vcpkg.sh | |
- run: vcpkg install curl openssl libyaml libgit2 libarchive libqrencode | |
- run: cmake --version | |
- run: cmake -S . -B build.d -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake -DCMAKE_INSTALL_PREFIX=./output -DBUILD_TESTING=OFF -DCMAKE_COLOR_MAKEFILE=ON -DCMAKE_VERBOSE_MAKEFILE=ON | |
- run: cmake --build build.d | |
- run: cmake --install build.d | |
- run: tree output | |
codacy-analysis: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@main | |
- uses: codacy/codacy-analysis-cli-action@master | |
with: | |
output: results.sarif | |
format: sarif | |
# Adjust severity of non-security issues | |
gh-code-scanning-compat: true | |
# Force 0 exit code to allow SARIF file generation | |
# This will handover control about PR rejection to the GitHub side | |
max-allowed-issues: 2147483647 | |
# Upload the SARIF file generated in the previous step | |
- name: Upload SARIF results file | |
uses: github/codeql-action/upload-sarif@main | |
with: | |
sarif_file: results.sarif |