Add a CI workflow to build and test the Cygwin and MinGW ports #78
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 on Cygwin and MinGW | |
on: | |
push: | |
pull_request: | |
# Restrict the GITHUB_TOKEN | |
permissions: {} | |
env: | |
# List of test directories for the debug-s4096 and linux-O0 jobs. These | |
# directories are selected because of their tendencies to reach corner cases | |
# in the runtime system. | |
PARALLEL_TESTS: parallel callback gc-roots weak-ephe-final | |
# Fully print commands executed by Make | |
# MAKEFLAGS: V=1 | |
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency | |
# Concurrent workflows are grouped by the PR or branch that triggered them | |
# (github.ref) and the name of the workflow (github.workflow). The | |
# 'cancel-in-progress' option then make sure that only one workflow is running | |
# at a time. This doesn't prevent new jobs from running, rather it cancels | |
# already running jobs before scheduling new jobs. | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name == 'pull_request' || github.sha }} | |
cancel-in-progress: true | |
jobs: | |
# This job will do the initial build of the compiler (on linux), with flambda on. | |
# We then upload the compiler tree as a build artifact to enable re-use in | |
# subsequent jobs. | |
build: | |
runs-on: windows-latest | |
name: ${{ matrix.name }} | |
strategy: | |
matrix: | |
include: | |
- name: cygwin | |
host: '' | |
# explicit x86_64-pc-cygwin must _not_ be specified | |
packages: gcc-core,gcc-fortran | |
- name: mingw | |
host: '--host=x86_64-w64-mingw32' | |
packages: mingw64-x86_64-gcc-core,mingw64-x86_64-gcc-g++ | |
fail-fast: false | |
steps: | |
- name: Configure EOLs on Cygwin | |
run: | | |
# Ensure that .expected files are not modified by check out | |
# as, in Cygwin, the .expected should use LF line endings, | |
# rather than Windows' CRLF | |
git config --global core.autocrlf input | |
if: matrix.name == 'cygwin' | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install Cygwin | |
uses: cygwin/cygwin-install-action@v4 | |
with: | |
packages: make,bash${{ matrix.packages }} | |
install-dir: 'D:\cygwin' | |
- name: Configure the compiler | |
shell: bash | |
run: >- | |
./configure --enable-ocamltest --disable-dependency-generation | |
${{ matrix.host }} | |
- name: Build the compiler | |
shell: bash | |
run: >- | |
make -j V=1 | |
- name: Show the configuration | |
shell: bash | |
run: >- | |
./ocamlopt.opt.exe -config | |
- name: Test suite | |
shell: bash | |
run: >- | |
make tests |