Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split the CI for Cygwin into 2 jobs rather than 2 workflows #313

Merged
merged 2 commits into from
Mar 22, 2023
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
40 changes: 11 additions & 29 deletions .github/workflows/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,9 @@ on:
default: 'ubuntu-latest'
cygwin:
description: >
Whether Cygwin should be used on Windows (empty if not), and
how ('waiter' will sleep 1 hour if the cache is not
initialized when it starts, 'initializer' will assume it has
the role of creating that cache)
type: string
default: ''
Whether Cygwin should be used on Windows
type: boolean
default: false
timeout:
description: 'Timeout'
type: number
Expand Down Expand Up @@ -129,7 +126,7 @@ jobs:
# Cygwin case
echo OPAMYES=1 >> $env:GITHUB_ENV
echo OPAMROOT=/cygdrive/d/opam >> $env:GITHUB_ENV
if: "runner.os == 'Windows' && inputs.cygwin != ''"
if: "runner.os == 'Windows' && inputs.cygwin"

- name: Checkout code
uses: actions/checkout@v2
Expand Down Expand Up @@ -224,7 +221,7 @@ jobs:
upstream: https://github.com/ocaml/opam-repository.git
opam-depext: false
cache-prefix: ${{ steps.presetup.outputs.cache_prefix }}
if: "runner.os == 'Windows' && inputs.cygwin == ''"
if: "runner.os == 'Windows' && !inputs.cygwin"

- name: Restore Cygwin packages (Cygwin)
uses: actions/cache/restore@v3
Expand All @@ -235,14 +232,14 @@ jobs:
path: |
C:\cygwin-packages
key: cygwin-packages-opam-2.0.7-1
if: "runner.os == 'Windows' && inputs.cygwin != ''"
if: "runner.os == 'Windows' && inputs.cygwin"

- name: Install Cygwin (in particular OPAM) (Cygwin)
uses: cygwin/cygwin-install-action@v3
with:
packages: opam
install-dir: 'D:\cygwin'
if: "runner.os == 'Windows' && inputs.cygwin != ''"
if: "runner.os == 'Windows' && inputs.cygwin"

- name: Save Cygwin packages (Cygwin)
uses: actions/cache/save@v3
Expand All @@ -252,7 +249,7 @@ jobs:
path: |
C:\cygwin-packages
key: cygwin-packages-opam-2.0.7-1
if: "runner.os == 'Windows' && inputs.cygwin == 'initializer' && steps.cache_cygwin.outputs.cache-hit != 'true'"
if: "runner.os == 'Windows' && inputs.cygwin && steps.cache_cygwin.outputs.cache-hit != 'true'"

- name: Restore OPAM state (Cygwin)
uses: actions/cache/restore@v3
Expand All @@ -263,22 +260,7 @@ jobs:
path: |
D:\opam
key: ${{ steps.presetup.outputs.cache_prefix }}-cygwin-opam-${{ env.COMPILER }}
if: "runner.os == 'Windows' && inputs.cygwin != ''"

- name: Wait for the cache (Cygwin)
run: sleep 3600
if: "runner.os == 'Windows' && inputs.cygwin == 'waiter' && steps.cache_opam.outputs.cache-hit != 'true'"

- name: Retry restoring OPAM packages (Cygwin)
uses: actions/cache/restore@v3
env:
PATH: ${{ steps.presetup.outputs.cache_path }}
with:
path: |
D:\opam
key: ${{ steps.presetup.outputs.cache_prefix }}-cygwin-opam-${{ env.COMPILER }}
fail-on-cache-miss: true
if: "runner.os == 'Windows' && inputs.cygwin == 'waiter' && steps.cache_opam.outputs.cache-hit != 'true'"
if: "runner.os == 'Windows' && inputs.cygwin"

- name: Install OCaml compiler ${{ env.COMPILER }} (Cygwin)
run: |
Expand All @@ -289,7 +271,7 @@ jobs:
opam repository add --all dra27 "https://github.com/dra27/opam-repository.git#windows-5.0"
opam repository add --all local "./.github/opam/custom/"
opam switch create default --repositories=dra27,override,windows,main --packages "${env:COMPILER}"
if: "runner.os == 'Windows' && inputs.cygwin == 'initializer' && steps.cache_opam.outputs.cache-hit != 'true'"
if: "runner.os == 'Windows' && inputs.cygwin && steps.cache_opam.outputs.cache-hit != 'true'"

- name: Set up macOS environment ($OPAMJOBS)
if: runner.os == 'macOS'
Expand All @@ -316,7 +298,7 @@ jobs:
path: |
D:\opam
key: ${{ steps.presetup.outputs.cache_prefix }}-cygwin-opam-${{ env.COMPILER }}
if: "runner.os == 'Windows' && inputs.cygwin == 'initializer'"
if: "runner.os == 'Windows' && inputs.cygwin"

- name: Build the test suite
run: opam exec -- dune build
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/cygwin-510-trunk-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Cygwin trunk

on: [push, pull_request, workflow_dispatch]

jobs:
part1:
uses: ./.github/workflows/common.yml
with:
runs_on: windows-latest
compiler: ocaml.5.1.0
cygwin: true
compiler_git_ref: refs/heads/trunk
timeout: 360
subsuite: src/array src/atomic src/bigarray src/buffer src/bytes src/domain src/dynlink src/ephemeron src/floatarray src/hashtbl src/io

part2:
needs: part1
if: ${{ always() }}
uses: ./.github/workflows/common.yml
with:
runs_on: windows-latest
compiler: ocaml.5.1.0
cygwin: true
compiler_git_ref: refs/heads/trunk
timeout: 360
subsuite: src/lazy src/neg_tests src/queue src/semaphore src/stack src/statistics src/sys src/thread src/threadomain src/weak
14 changes: 0 additions & 14 deletions .github/workflows/cygwin1-510-trunk-workflow.yml

This file was deleted.

14 changes: 0 additions & 14 deletions .github/workflows/cygwin2-510-trunk-workflow.yml

This file was deleted.

4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ Multicore tests
[![Linux 32-bit 5.1.0+trunk](https://github.com/ocaml-multicore/multicoretests/actions/workflows/linux-510-32bit-trunk-workflow.yml/badge.svg)](https://github.com/ocaml-multicore/multicoretests/actions/workflows/linux-510-32bit-trunk-workflow.yml)
[![Windows 5.1.0+trunk](https://github.com/ocaml-multicore/multicoretests/actions/workflows/windows-510-trunk-workflow.yml/badge.svg)](https://github.com/ocaml-multicore/multicoretests/actions/workflows/windows-510-trunk-workflow.yml)
[![Windows 5.1.0+trunk-bytecode](https://github.com/ocaml-multicore/multicoretests/actions/workflows/windows-510-trunk-bytecode-workflow.yml/badge.svg)](https://github.com/ocaml-multicore/multicoretests/actions/workflows/windows-510-trunk-bytecode-workflow.yml)

[![Cygwin trunk (1)](https://github.com/ocaml-multicore/multicoretests/actions/workflows/cygwin1-510-trunk-workflow.yml/badge.svg)](https://github.com/ocaml-multicore/multicoretests/actions/workflows/cygwin1-510-trunk-workflow.yml)
[![Cygwin trunk (2)](https://github.com/ocaml-multicore/multicoretests/actions/workflows/cygwin2-510-trunk-workflow.yml/badge.svg)](https://github.com/ocaml-multicore/multicoretests/actions/workflows/cygwin2-510-trunk-workflow.yml)
[![Cygwin 5.1.0+trunk](https://github.com/ocaml-multicore/multicoretests/actions/workflows/cygwin-510-trunk-workflow.yml/badge.svg)](https://github.com/ocaml-multicore/multicoretests/actions/workflows/cygwin-510-trunk-workflow.yml)

Property-based tests of (parts of) the OCaml multicore compiler and run time.

Expand Down