gha/windows: Re-enabled the MSVC flow as a test to see if GHA sorted … #34
Workflow file for this run
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: 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 }})' | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: | |
- windows-2022 | |
arch: | |
- x86 | |
- amd64 | |
fail-fast: false | |
env: | |
CC: cl.exe | |
CXX: cl.exe | |
LD: link.exe | |
BUILD_OPTS: '' | |
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 == 'blackmagic-debug/bmpflash' | |
uses: crazy-max/ghaction-chocolatey@v2.1.0 | |
with: | |
args: install OpenCppCoverage | |
- name: Setup OpenCppCoverage | |
if: github.repository == 'blackmagic-debug/bmpflash' | |
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 $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 == 'blackmagic-debug/bmpflash' | |
run: | | |
Remove-Item -Recurse build | |
meson setup build --prefix=$HOME/.local -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.arch }} | |
path: | | |
${{ github.workspace }}/build/meson-logs | |
${{ github.workspace }}/build/test | |
retention-days: 5 | |
- name: Codecov | |
if: success() && github.repository == 'blackmagic-debug/bmpflash' | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
build-windows-mingw: | |
name: '${{ matrix.os }} (${{ matrix.sys }})' | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: msys2 {0} | |
strategy: | |
matrix: | |
os: | |
- windows-2019 | |
sys: | |
- mingw64 | |
- ucrt64 | |
- clang64 | |
fail-fast: false | |
env: | |
BUILD_OPTS: '' | |
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 build --prefix=$HOME/.local $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 == 'blackmagic-debug/bmpflash' | |
# Codecov no longer parses gcov files automatically | |
run: | | |
rm -rf build | |
meson setup build --prefix=$HOME/.local -Db_coverage=true --buildtype=debug | |
meson compile -C build | |
meson test -C build | |
ninja -C build coverage-xml | |
- name: Upload failure logs | |
if: failure() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: logs-${{ matrix.os }}-${{ matrix.sys }} | |
path: ${{ github.workspace }}/build/meson-logs/* | |
retention-days: 5 | |
- name: Codecov | |
if: success() && github.repository == 'blackmagic-debug/bmpflash' | |
uses: codecov/codecov-action@v3 | |
with: | |
directory: ./build/meson-logs/ | |
files: coverage.xml | |
token: ${{ secrets.CODECOV_TOKEN }} |