Skip to content

Build-and-Test

Build-and-Test #133

name: Build-and-Test
on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
linux-job:
name: Ubuntu
runs-on: ${{ matrix.os }}
continue-on-error: false
strategy:
fail-fast: true
matrix:
os: [ubuntu-22.04]
include:
- os: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Fetch Clang
uses: ./.github/actions/apt-fetch-clang
- name: Get cmake option
id: cmake-option
run: echo "cmake-option=-DVCPKG_TARGET_TRIPLET=x64-linux-clang -DVCPKG_HOST_TRIPLET=x64-linux-clang-dynamic -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=\"${{ github.workspace }}/.vcpkg/scripts/toolchains/linux-clang.cmake\"" >> $GITHUB_OUTPUT
- name: CMake build and test (Debug)
uses: ./.github/actions/cmake-build-and-test
with:
config-option: ${{ steps.cmake-option.outputs.cmake-option }} -DCODE_COVERAGE_EXT="lcov" -DENABLE_CLANG_TIDY=true
before-build: \cp -rf ./cmake/vcpkg/* ./.vcpkg/
build-dir: .build/Debug
- name: CMake build and test (Release)
uses: ./.github/actions/cmake-build-and-test
with:
build-type: Release
config-option: ${{ steps.cmake-option.outputs.cmake-option }}
build-dir: .build/Release
- name: Codacy Coverage Reporter
uses: codacy/[email protected]
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: .build/Debug/tests/stdsharpTestsCoverage.lcov
- name: Codacy Analysis
uses: codacy/codacy-analysis-cli-action@master
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
upload: true
run-docker-tools: false
clang-tidy-output: ".build/Debug/cmake-build.log"
windows-job:
name: Windows
runs-on: ${{ matrix.os }}
continue-on-error: false
strategy:
fail-fast: true
matrix:
os: [windows-latest]
steps:
- uses: actions/checkout@v4
- name: Update MSVC
uses: ./.github/actions/update-msvc
- uses: ilammy/msvc-dev-cmd@v1
- name: CMake build and test (Debug)
uses: ./.github/actions/cmake-build-and-test
with:
build-dir: .build/Debug
- name: CMake build and test (Release)
uses: ./.github/actions/cmake-build-and-test
with:
build-type: Release
build-dir: .build/Release