Setting up Cygwin CI environment for testing one of my projects took more than fifty trial-and-error attempts - that's why I think it will be useful to leave some written notes on the issues I've encountered. Here is the end result - GitHub CI running some Makefile tests in Cygwin.

Cygwin gotchas

PowerShell/cmd peculiarities

Since host OS is still Windows, you get to encounter all the usual PowerShell/cmd quirks. I tripped over the fact that PowerShell does not like double-dashed --GNU-style options, and over weird nested quotes required to properly combine environment variables and special characters in one value in cmd.

GitHub CI

Some of my attempts were just me trying to work around GitHub CI limitations. For example, dynamically calculating the value of environment variable based on values of other variables. This looks quite ugly:

- name: Use absolute path for CYGWIN_ROOT
  run: echo "::set-env name=CYGWIN_ROOT::${env:GITHUB_WORKSPACE}\${env:CYGWIN_ROOT}"

I've also failed at proper syntax for YAML multiline strings more times than I'm comfortable admitting :)