Skip to content

Switched to using unescaped_variables to get the right behaviour ou… #86

Switched to using unescaped_variables to get the right behaviour ou…

Switched to using unescaped_variables to get the right behaviour ou… #86

Workflow file for this run

name: Build Windows
on:
push:
branches-ignore:
- 'coverityScan'
pull_request:
branches:
- 'main'
concurrency:
group: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-windows:
name: '${{ matrix.os }} (msvc ${{ matrix.arch }}, ${{ matrix.cpp_std }})'
runs-on: ${{ matrix.os }}
defaults:
run:
shell: pwsh
strategy:
matrix:
os:
- windows-2019
- windows-2022
arch:
- x86
- amd64
cpp_std:
- 'c++14'
- 'c++17'
fail-fast: false
env:
CC: cl.exe
CXX: cl.exe
LD: link.exe
steps:
- name: Runtime environment
env:
WORKSPACE: ${{ github.workspace }}
run: |
echo "${env:HOME}/.local/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "GITHUB_WORKSPACE=${{ env.WORKSPACE }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Setup compiler
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
- name: Install OpenCppCoverage
if: github.repository == 'dragonmux/crunch'
uses: crazy-max/ghaction-chocolatey@v2.1.0
with:
args: install OpenCppCoverage
- name: Setup OpenCppCoverage
if: github.repository == 'dragonmux/crunch'
run: |
echo "C:/Program Files/OpenCppCoverage" >> $env:GITHUB_PATH
- name: Checkout
uses: actions/checkout@v3
with:
lfs: true
submodules: true
- name: Setup Meson + Ninja
shell: bash
run: |
python3 -m pip install --upgrade pip setuptools wheel
python3 -m pip install meson ninja
working-directory: ${{ runner.temp }}
- name: Version tools
run: |
cl /Bv
link
meson --version
ninja --version
- name: Configure
run: meson setup build --prefix=$HOME/.local -Dcpp_std=${{ matrix.cpp_std }} $BUILD_OPTS
- name: Build
run: meson compile -C build
- name: Test
run: meson test -C build
- name: Install
run: meson install -C build
- name: Run coverage build
if: github.repository == 'dragonmux/crunch'
run: |
Remove-Item -Recurse build
meson setup build --prefix=$HOME/.local -Dcpp_std=${{ matrix.cpp_std }} -Db_coverage=true --buildtype=debug -Ddefault_library=static
meson compile -C build
meson test -C build
- name: Upload failure logs
if: failure()
uses: actions/upload-artifact@v3
with:
name: logs-${{ matrix.os }}-${{ matrix.cpp_std }}
path: ${{ github.workspace }}/build
retention-days: 5
- name: Codecov
if: success() && github.repository == 'dragonmux/crunch'
uses: codecov/codecov-action@v3
build-windows-mingw:
name: '${{ matrix.os }} (${{ matrix.sys }}, ${{ matrix.cpp_std }})'
runs-on: ${{ matrix.os }}
defaults:
run:
shell: msys2 {0}
strategy:
matrix:
os:
- windows-2019
sys:
- mingw64
- ucrt64
- clang64
cpp_std:
- 'c++11'
- 'c++14'
- 'c++17'
fail-fast: false
steps:
- name: Use MinGW from MSYS
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.sys }}
update: true
path-type: inherit
pacboy: >-
toolchain:p
lcov:p
- name: Runtime environment
env:
WORKSPACE: ${{ github.workspace }}
run: |
echo "$HOME/.local/bin" >> $GITHUB_PATH
echo "GITHUB_WORKSPACE=${{ env.WORKSPACE }}" >> $GITHUB_ENV
- name: Setup GCC
if: startsWith(matrix.sys, 'mingw') || startsWith(matrix.sys, 'ucrt64')
run: |
echo "GCOV=gcov" >> $GITHUB_ENV
- name: Setup Clang
if: startsWith(matrix.sys, 'clang')
run: |
echo "GCOV=llvm-cov gcov" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v3
with:
lfs: true
submodules: true
- name: Setup Meson + Ninja + gcovr
shell: bash
run: |
python3 -m pip install --upgrade pip setuptools wheel
python3 -m pip install meson ninja gcovr
working-directory: ${{ runner.temp }}
- name: Version tools
run: |
cc --version
c++ --version
$GCOV --version
meson --version
ninja --version
- name: Configure
run: meson setup build --prefix=$HOME/.local -Dcpp_std=${{ matrix.cpp_std }} $BUILD_OPTS
- name: Build
run: meson compile -C build
- name: Test
run: meson test -C build
- name: Install
run: meson install -C build
- name: Run coverage build
if: github.repository == 'dragonmux/crunch'
# Codecov no longer parses gcov files automatically
run: |
rm -rf build
meson setup build --prefix=$HOME/.local -Dcpp_std=${{ matrix.cpp_std }} -Db_coverage=true --buildtype=debug
meson compile -C build
meson test -C build
cd build
find . -type f -name '*.gcda' -exec $GCOV -p {} + > /dev/null
gcovr -r .. -x coverage.xml --gcov-executable "$GCOV" -e ../deps -e ../test
- name: Upload failure logs
if: failure()
uses: actions/upload-artifact@v3
with:
name: logs-${{ matrix.os }}-${{ matrix.sys }}-${{ matrix.cpp_std }}
path: ${{ github.workspace }}/build
retention-days: 5
- name: Codecov
if: success() && github.repository == 'dragonmux/crunch'
uses: codecov/codecov-action@v3
with:
directory: ./build
files: coverage.xml