2022-02-16 07:06:04 +01:00
# Some convenient links:
# - https://github.com/actions/virtual-environments/blob/master/images/win/Windows2019-Readme.md
#
name : CI-mingw
2023-09-01 18:52:20 +02:00
on :
push :
branches :
- 'main'
- 'releases/**'
tags :
- '2.*'
pull_request :
2022-02-16 07:06:04 +01:00
2022-08-26 23:25:07 +02:00
permissions :
contents : read
2022-02-16 07:06:04 +01:00
defaults :
run :
2023-09-04 13:56:18 +02:00
shell : msys2 {0}
2022-02-16 07:06:04 +01:00
jobs :
build_mingw :
strategy :
matrix :
2023-09-04 13:56:18 +02:00
# the MinGW installation in windows-2019 is supposed to be 8.1 but it is 12.2
# the MinGW installation in windows-2022 is not including all necessary packages by default, so just use the older image instead - package versions are he same
os : [ windows-2019]
2022-02-16 07:06:04 +01:00
fail-fast : false
runs-on : ${{ matrix.os }}
steps :
2022-10-11 19:50:59 +02:00
- uses : actions/checkout@v3
2022-02-16 07:06:04 +01:00
2023-09-04 13:56:18 +02:00
- name : Set up MSYS2
uses : msys2/setup-msys2@v2
2022-02-16 07:06:04 +01:00
with :
2023-09-04 13:56:18 +02:00
release : false # use pre-installed
install : >-
mingw-w64-x86_64-lld
mingw-w64-x86_64-ccache
2022-02-16 07:06:04 +01:00
2023-09-04 13:56:18 +02:00
- name : ccache
uses : hendrikmuhs/ccache-action@v1.2
with :
key : ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
2023-10-09 12:25:56 +02:00
# TODO: bail out on warning
2023-09-04 13:56:18 +02:00
- name : Build cppcheck
run : |
export PATH="/mingw64/lib/ccache/bin:$PATH"
# set RDYNAMIC to work around broken MinGW detection
make VERBOSE=1 RDYNAMIC=-lshlwapi -j2 cppcheck
env :
LDFLAGS : -fuse-ld=lld # use lld for faster linking
- name : Build test
run : |
export PATH="/mingw64/lib/ccache/bin:$PATH"
# set RDYNAMIC to work around broken MinGW detection
make VERBOSE=1 RDYNAMIC=-lshlwapi -j2 testrunner
env :
LDFLAGS : -fuse-ld=lld # use lld for faster linking
- name : Run test
2022-02-16 07:06:04 +01:00
run : |
2023-09-04 13:56:18 +02:00
export PATH="/mingw64/lib/ccache/bin:$PATH"
# set RDYNAMIC to work around broken MinGW detection
make VERBOSE=1 RDYNAMIC=-lshlwapi -j2 check
env :
LDFLAGS : -fuse-ld=lld # use lld for faster linking