Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 9 additions & 28 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
# the VERSION file plus the short commit hash (see below).
version: '{build}'

# AppVeyor builds the Visual Studio solution with the Visual Studio 2015
# toolchain, the oldest MSVC in CI. Everything else, including the Cygwin
# build, runs on GitHub Actions (.github/workflows/builds.yml).
os: Visual Studio 2015

environment:
matrix:
- BUILD_ENV: msbuild
arch: x64
- BUILD_ENV: msbuild
arch: Win32
- BUILD_ENV: cygwin
- arch: x64
- arch: Win32

# Derive the build version from the repo: <VERSION>-<short commit>.<build number>,
# e.g. 0.16.0-1a2b3c4.42. The build number keeps it unique even if the same
Expand All @@ -21,26 +23,5 @@ before_build:
$short = git rev-parse --short HEAD
Update-AppveyorBuild -Version "$base-$short.$env:APPVEYOR_BUILD_NUMBER"

for:
-
matrix:
only:
- BUILD_ENV: msbuild

os: Visual Studio 2015

build_script:
- cmd: msbuild .\windows\hidapi.sln /p:Configuration=Release /p:Platform=%arch% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"

-
matrix:
only:
- BUILD_ENV: cygwin

os: Visual Studio 2022

install:
- cmd: C:\cygwin64\setup-x86_64.exe --quiet-mode --no-shortcuts --upgrade-also --packages autoconf,automake

build_script:
- cmd: C:\cygwin64\bin\bash -exlc "cd $APPVEYOR_BUILD_FOLDER; ./bootstrap; ./configure; make"
build_script:
- cmd: msbuild .\windows\hidapi.sln /p:Configuration=Release /p:Platform=%arch% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
58 changes: 58 additions & 0 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,64 @@ jobs:
run: ctest --no-compress-output --output-on-failure


windows-cygwin:

runs-on: windows-latest

defaults:
run:
# A login shell with CYGWIN_NOWINPATH set gets a Cygwin-only PATH, so
# no toolchain preinstalled on the runner (MinGW gcc, Strawberry Perl,
# ...) leaks into the build. CHERE_INVOKING keeps the step's working
# directory; igncr because the runner writes step scripts with CRLF.
shell: C:\cygwin\bin\bash.exe --login -o igncr -eo pipefail '{0}'

env:
CYGWIN_NOWINPATH: 1
CHERE_INVOKING: 1

steps:
# The autotools under Cygwin need LF line endings, not the runner's
# default core.autocrlf=true checkout.
- name: Check out with LF line endings
shell: pwsh
run: git config --global core.autocrlf input
- uses: actions/checkout@v4
# gcc-g++ too: configure.ac runs AC_PROG_CXX, and without a C++ compiler
# libtool's C++ preprocessor check fails configure.
- name: Install Cygwin
uses: cygwin/cygwin-install-action@v7
with:
add-to-path: false
packages: autoconf automake libtool make gcc-core gcc-g++ pkg-config
- name: Configure Automake
run: |
./bootstrap
./configure
- name: Build Automake
run: |
# Warning flags go to make rather than configure, where -Werror would
# break configure's own feature tests.
make V=1 CFLAGS="-g -O2 ${GNU_COMPILE_FLAGS}"
make DESTDIR="${PWD}/install" install
- name: Check artifacts
uses: andstor/file-existence-action@v2
with:
files: "install/usr/local/bin/cyghidapi-0.dll, \
install/usr/local/lib/libhidapi.dll.a, \
install/usr/local/include/hidapi/hidapi.h, \
install/usr/local/lib/pkgconfig/hidapi.pc, \
install/usr/local/lib/pkgconfig/hidapi-winapi.pc"
fail: true
- name: Run hidtest
timeout-minutes: 2
run: |
# Runtime smoke test of the Cygwin build: hid_init() and hid_enumerate()
# must work. No test device is attached, so hidtest ends with
# "unable to open device" and exit code 1.
./hidtest/hidtest || test $? -eq 1


windows-msbuild:

runs-on: windows-latest
Expand Down
Loading