Skip to content

Minor code fix to make library compatible with DirectXTex October 2024 #246

Minor code fix to make library compatible with DirectXTex October 2024

Minor code fix to make library compatible with DirectXTex October 2024 #246

Workflow file for this run

name: Main CI
on:
push:
branches: [master]
paths:
- '**/*.cpp'
- '**/*.hpp'
- '**/CMakeLists.txt'
- '**/CMakePresets.txt'
- '**/cmake/**'
- '**/vcpkg.json'
- '.github/workflows/main_ci.yml'
- 'codecov.yml'
pull_request:
branches: [master]
workflow_dispatch:
env:
BUILD_TYPE: Debug
VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}/vcpkg-cache
jobs:
linux:
runs-on: ubuntu-latest
strategy:
matrix:
config: [gcc]
include:
- config: gcc
version: '10'
steps:
- uses: actions/checkout@v2
with:
path: bsa
- name: Set up GCC
uses: egor-tensin/setup-gcc@v1
with:
version: ${{ matrix.version }}
- name: Setup vcpkg
run: |
mkdir ${{ env.VCPKG_DEFAULT_BINARY_CACHE }}
cd $VCPKG_INSTALLATION_ROOT
./bootstrap-vcpkg.sh
./vcpkg --version > ${{ github.workspace }}/vcpkg-version.txt
- name: Cache vcpkg
uses: actions/cache@v2
env:
cache-name: vcpkg-cache
with:
path: ${{ env.VCPKG_DEFAULT_BINARY_CACHE }}/*
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('bsa/vcpkg.json', 'vcpkg-version.txt') }}
- name: Setup Environment
run: |
echo "GCOV=gcov-${{ matrix.version }}" >> $GITHUB_ENV
wget https://github.com/ninja-build/ninja/releases/download/v1.11.0/ninja-linux.zip
unzip ninja-linux.zip
sudo mv ninja /usr/local/bin
sudo apt install liblz4-dev zlib1g-dev -y
sudo pip install gcovr
- name: Configure & Build
working-directory: ${{ github.workspace }}/bsa
run: |
cmake --preset linux-gcc-vcpkg -G Ninja -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DBSA_BUILD_DOCS=OFF
cmake --build build
- name: Test
working-directory: ${{ github.workspace }}/bsa/build
env:
gcovr: gcovr -r .. . --coveralls --exclude-unreachable-branches --exclude-function-lines --exclude-throw-branches
run: |
(cd tests && ./tests [src])
${{ env.gcovr }} -f ".*/src/bsa/.*" -f ".*/include/bsa/.*" -o src.json
find -type f -name *.gcda | xargs rm
(cd tests && ./tests [examples])
${{ env.gcovr }} -f ".*/examples/.*" -o examples.json
- name: Collect code coverage
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: true
files: bsa/build/examples.json,bsa/build/src.json
verbose: true
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
path: bsa
- name: Install OpenCPPCoverage
working-directory: ${{ github.workspace }}/bsa/scripts/opencppcoverage
run: |
choco pack
choco install opencppcoverage -s . -y
- name: Install XNA Framework Redistributables
run: choco install xna -y
- name: Setup vcpkg
run: |
mkdir -p ${{ env.VCPKG_DEFAULT_BINARY_CACHE }}
cd $env:VCPKG_INSTALLATION_ROOT
./bootstrap-vcpkg.bat
./vcpkg --version > ${{ github.workspace }}/vcpkg-version.txt
- name: Cache vcpkg
uses: actions/cache@v2
env:
cache-name: vcpkg-cache
with:
path: ${{ env.VCPKG_DEFAULT_BINARY_CACHE }}/*
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('bsa/**/vcpkg.json', 'vcpkg-version.txt') }}
- name: Setup MSVC (x86)
uses: egor-tensin/vs-shell@v2
with:
arch: x86
- name: (xmem) Configure & Build
working-directory: ${{ github.workspace }}/bsa/extras/xmem
run: |
cmake --preset windows-msvc-vcpkg -G Ninja
cmake --build build --config ${{ env.BUILD_TYPE }}
- name: (xmem) Test
working-directory: ${{ github.workspace }}/bsa/extras/xmem/build
run: |
& "$($env:SystemDrive)/Program Files/OpenCppCoverage/OpenCppCoverage.exe" --sources bsa\extras\xmem\src --sources bsa\extras\xmem\tests --cover_children --export_type cobertura -- ctest -C ${{ env.BUILD_TYPE }} -V
- name: (xmem) Collect code coverage
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: true
files: build/ctestCoverage.xml
working-directory: ${{ github.workspace }}/bsa/extras/xmem/build
- name: (xmem) Install
working-directory: ${{ github.workspace }}/bsa/extras/xmem
run: cmake --install build --config ${{ env.BUILD_TYPE }}
- name: (main) Setup MSVC (x64)
uses: egor-tensin/vs-shell@v2
with:
arch: x64
- name: (main) Configure & Build
working-directory: ${{ github.workspace }}/bsa
run: |
cmake --preset windows-msvc-vcpkg -G Ninja -DBSA_BUILD_DOCS=OFF
cmake --build build --config ${{ env.BUILD_TYPE }}
- name: (main) Test
working-directory: ${{ github.workspace }}/bsa/build
run: |
& "$($env:SystemDrive)/Program Files/OpenCppCoverage/OpenCppCoverage.exe" --sources bsa\examples --sources bsa\extras\xmem\src --sources bsa\src --sources bsa\tests --cover_children --export_type cobertura -- ctest -C ${{ env.BUILD_TYPE }} -V
- name: (main) Collect code coverage
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: true
files: build/ctestCoverage.xml
working-directory: ${{ github.workspace }}/bsa/build