Skip to content

Windows CI workflow #14

Windows CI workflow

Windows CI workflow #14

Workflow file for this run

name: C/C++ CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.sys.os }}
strategy:
matrix:
sys:
- { os: ubuntu-latest, shell: bash, make: make }
- { os: macos-latest, shell: bash, make: make }
- { os: windows-latest, shell: 'msys2 {0}', make: mingw64-make }
defaults:
run:
shell: ${{ matrix.sys.shell }}
steps:
- uses: actions/checkout@v4
- if: ${{ runner.os == 'Windows' }}
# based on https://www.msys2.org/docs/ci/
uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
update: true
install: git mingw-w64-ucrt-x86_64-gcc
- if: ${{ runner.os == 'Windows' }}
shell: powershell
run: |
choco install make
for i in $(echo $PATH | tr : \\n); do
echo "i = $i"
find "$i" -name '*make*' || true
echo
done
echo "which make = '$(which make)'"
# run: yes | (pacman -S make || pacman -S make)
- name: make
run: |
for i in $(echo $PATH | tr : \\n); do
echo "i = $i"
find "$i" -name '*make*' || true
echo
done
${{ matrix.sys.make }} clean && ${{ matrix.sys.make }} -j || true
- name: make check
run: |
# Test output is too verbose, so only show it if something fails.
testout="$(${{ matrix.sys.make }} check -j 2>&1)" &&
(printf '[...output omitted...]\n' &&
printf '%s\n' "$testout" | tail -n200) ||
(printf '%s\n' "$testout"; exit 1)