diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..dfdb8b771 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.sh text eol=lf diff --git a/.github/opam/custom/repo b/.github/opam/custom/repo deleted file mode 100644 index 013b84db6..000000000 --- a/.github/opam/custom/repo +++ /dev/null @@ -1 +0,0 @@ -opam-version: "2.0" diff --git a/.github/opam/ocaml-variants.opam.unix b/.github/opam/ocaml-variants.opam.unix deleted file mode 100644 index 2de3f476e..000000000 --- a/.github/opam/ocaml-variants.opam.unix +++ /dev/null @@ -1,107 +0,0 @@ -opam-version: "2.0" -synopsis: "Custom compiler __OCAML_COMPILER_FULL_VERSION__" -maintainer: "platform@lists.ocaml.org" -authors: [ - "Xavier Leroy" - "Damien Doligez" - "Alain Frisch" - "Jacques Garrigue" - "Didier Rémy" - "Jérôme Vouillon" -] -license: "LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception" -homepage: "https://ocaml.org" -bug-reports: "https://github.com/ocaml/opam-repository/issues" -depends: [ - "ocaml" {= "__OCAML_OPAM_PACKAGE_VERSION__" & post} - "base-unix" {post} - "base-bigarray" {post} - "base-threads" {post} - "base-domains" {post} - "base-nnp" {post} - "ocaml-option-bytecode-only" {arch != "arm64" & arch != "x86_64"} - "ocaml-beta" {opam-version < "2.1.0"} -] -depopts: [ - "ocaml-option-32bit" - "ocaml-option-afl" - "ocaml-option-bytecode-only" - "ocaml-option-no-flat-float-array" - "ocaml-option-flambda" - "ocaml-option-fp" - "ocaml-option-musl" - "ocaml-option-leak-sanitizer" - "ocaml-option-address-sanitizer" - "ocaml-option-static" -] -conflict-class: "ocaml-core-compiler" -flags: [compiler avoid-version] -setenv: CAML_LD_LIBRARY_PATH = "%{lib}%/stublibs" -build: [ - [ - "./configure" - "--prefix=%{prefix}%" - "--docdir=%{doc}%/ocaml" - "-C" - "--with-afl" {ocaml-option-afl:installed} - "--disable-native-compiler" {ocaml-option-bytecode-only:installed} - "--disable-flat-float-array" {ocaml-option-no-flat-float-array:installed} - "--enable-flambda" {ocaml-option-flambda:installed} - "--enable-frame-pointers" {ocaml-option-fp:installed} - "CC=cc" - {!ocaml-option-32bit:installed & !ocaml-option-musl:installed & - (os = "openbsd" | os = "macos")} - "CC=musl-gcc" {ocaml-option-musl:installed & os-distribution != "alpine"} - "CFLAGS=-Os" {ocaml-option-musl:installed} - "LDFLAGS=-Wl,--no-as-needed,-ldl" - {ocaml-option-leak-sanitizer:installed | - ocaml-option-address-sanitizer:installed & os != "macos"} - "CC=gcc -ldl -fsanitize=leak -fno-omit-frame-pointer -O1 -g" - {ocaml-option-leak-sanitizer:installed} - "CC=gcc -ldl -fsanitize=address -fno-omit-frame-pointer -O1 -g" - {ocaml-option-address-sanitizer:installed & os != "macos"} - "CC=clang -fsanitize=address -fno-omit-frame-pointer -O1 -g" - {ocaml-option-address-sanitizer:installed & os = "macos"} - "CC=gcc -m32" {ocaml-option-32bit:installed & os = "linux"} - "CC=gcc -Wl,-read_only_relocs,suppress -arch i386 -m32" - {ocaml-option-32bit:installed & os = "macos"} - "ASPP=cc -c" - {!ocaml-option-32bit:installed & !ocaml-option-musl:installed & - (os = "openbsd" | os = "macos")} - "ASPP=musl-gcc -c" - {ocaml-option-musl:installed & os-distribution != "alpine"} - "ASPP=gcc -m32 -c" {ocaml-option-32bit:installed & os = "linux"} - "ASPP=gcc -arch i386 -m32 -c" - {ocaml-option-32bit:installed & os = "macos"} - "AS=as --32" {ocaml-option-32bit:installed & os = "linux"} - "AS=as -arch i386" {ocaml-option-32bit:installed & os = "macos"} - "--host=i386-linux" {ocaml-option-32bit:installed & os = "linux"} - "--host=i386-apple-darwin13.2.0" - {ocaml-option-32bit:installed & os = "macos"} - "PARTIALLD=ld -r -melf_i386" - {ocaml-option-32bit:installed & os = "linux"} - "LIBS=-static" {ocaml-option-static:installed} - "--disable-warn-error" - ] - [make "-j%{jobs}%"] -] -install: [make "install"] -build-env: [ - [LSAN_OPTIONS = "detect_leaks=0,exitcode=0"] - [ASAN_OPTIONS = "detect_leaks=0,exitcode=0"] -] -post-messages: [ - """\ -A failure in the middle of the build may be caused by build parallelism - (enabled by default). - See https://github.com/ocaml/opam-repository/pull/14257 for more info.""" - {failure & jobs > "1" & os != "cygwin"} - """\ -You can try installing again including --jobs=1 - to force a sequential build instead.""" - {failure & jobs > "1" & os != "cygwin" & opam-version >= "2.0.5"} -] -dev-repo: "git+https://github.com/ocaml/ocaml.git" -url { - src: "__OCAML_COMPILER_SRC__" -} diff --git a/.github/opam/ocaml-variants.opam.windows b/.github/opam/ocaml-variants.opam.windows deleted file mode 100644 index 0dbe3bd70..000000000 --- a/.github/opam/ocaml-variants.opam.windows +++ /dev/null @@ -1,121 +0,0 @@ -opam-version: "2.0" -synopsis: "Custom compiler __OCAML_COMPILER_FULL_VERSION__" -license: "LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception" -maintainer: "platform@lists.ocaml.org" -authors: ["Xavier Leroy" "Damien Doligez" "Alain Frisch" "Jacques Garrigue" "Didier Rémy" "Jérôme Vouillon"] -homepage: "https://ocaml.org" -bug-reports: "https://github.com/ocaml-multicore/multicoretests/issues" -dev-repo: "git+https://github.com/ocaml/ocaml.git" -depends: [ - "ocaml" {= "__OCAML_OPAM_PACKAGE_VERSION__" & post} - "base-unix" {post} - "base-bigarray" {post} - "base-threads" {post} - "base-domains" {post} - "base-nnp" {post} - "ocaml-option-bytecode-only" {arch != "arm64" & arch != "x86_64"} - "conf-flexdll" {os = "cygwin"} - ("flexdll" {os = "win32"} | "flexdll-bin" {os = "win32"} & "flexlink" {os = "win32" & post}) -] -conflict-class: "ocaml-core-compiler" -flags: compiler -setenv: CAML_LD_LIBRARY_PATH = "%{lib}%/stublibs" -build-env: [ - [PATH += "%{lib}%/%{flexdll-bin:installed?flexdll-bin:ocaml}%"] - [LSAN_OPTIONS = "detect_leaks=0,exitcode=0"] - [ASAN_OPTIONS = "detect_leaks=0,exitcode=0"] -] -build: [ - [ - # General configuration - "./configure" "-C" "--prefix=%{prefix}%" "--docdir=%{doc}%/ocaml" - - # Windows-specific configuration - "--with-flexdll=%{flexdll:share}%" {flexdll:installed} - - # Options - "--disable-warn-error" - - "--enable-native-compiler" {!ocaml-option-bytecode-only:installed} - "--disable-native-compiler" {ocaml-option-bytecode-only:installed} - - "--with-afl" {ocaml-option-afl:installed} - "--disable-flat-float-array" {ocaml-option-no-flat-float-array:installed} - "--enable-flambda" {ocaml-option-flambda:installed} - "--enable-frame-pointers" {ocaml-option-fp:installed} - - "LIBS=-static" {ocaml-option-static:installed} - - # Force use of cc for macOS and OpenBSD - "CC=cc" {!ocaml-option-32bit:installed & !ocaml-option-musl:installed & (os="openbsd"|os="macos")} - "ASPP=cc -c" {!ocaml-option-32bit:installed & !ocaml-option-musl:installed & (os="openbsd"|os="macos")} - - # Windows ports - "--build=x86_64-pc-cygwin" {os = "win32" & arch = "x86_64"} - "--build=i686-pc-cygwin" {os = "win32" & arch = "i686"} - # Fix on Cygwin - "--enable-imprecise-c99-float-ops" {os = "cygwin"} - - "--host=i686-w64-mingw32" {ocaml-option-mingw:installed & ocaml-option-32bit:installed} - "--host=x86_64-w64-mingw32" {ocaml-option-mingw:installed & !ocaml-option-32bit:installed} - "--host=i686-pc-windows" {ocaml-option-msvc:installed & ocaml-option-32bit:installed} - "--host=x86_64-pc-windows" {ocaml-option-msvc:installed & !ocaml-option-32bit:installed} - - # Compilation with musl - "CC=musl-gcc" {ocaml-option-musl:installed & os-distribution!="alpine"} - "CFLAGS=-Os" {ocaml-option-musl:installed} - "ASPP=musl-gcc -c" {ocaml-option-musl:installed & os-distribution!="alpine"} - - # Compilation with sanitisers - "LDFLAGS=-Wl,--no-as-needed,-ldl" {ocaml-option-leak-sanitizer:installed | (ocaml-option-address-sanitizer:installed & os!="macos")} - "CC=gcc -ldl -fsanitize=leak -fno-omit-frame-pointer -O1 -g" {ocaml-option-leak-sanitizer:installed} - "CC=gcc -ldl -fsanitize=address -fno-omit-frame-pointer -O1 -g" {ocaml-option-address-sanitizer:installed & os!="macos"} - "CC=clang -fsanitize=address -fno-omit-frame-pointer -O1 -g" {ocaml-option-address-sanitizer:installed & os="macos"} - - # 32-bit compilation (Linux) - "--host=i386-pc-linux-gnu" {ocaml-option-32bit:installed & os="linux"} - "CC=gcc -m32" {ocaml-option-32bit:installed & os="linux"} - "AS=as --32" {ocaml-option-32bit:installed & os="linux"} - "ASPP=gcc -m32 -c" {ocaml-option-32bit:installed & os="linux"} - "PARTIALLD=ld -r -melf_i386" {ocaml-option-32bit:installed & os="linux"} - - # 32-bit compilation (macOS) - "--host=i386-apple-darwin" {ocaml-option-32bit:installed & os="macos"} - "CC=gcc -Wl,-read_only_relocs,suppress -arch i386 -m32" {ocaml-option-32bit:installed & os="macos"} - "AS=as -arch i386" {ocaml-option-32bit:installed & os="macos"} - "ASPP=gcc -arch i386 -m32 -c" {ocaml-option-32bit:installed & os="macos"} - ] - [make "-j%{jobs}%"] -] -install: [make "install"] -url { - src: "__OCAML_COMPILER_SRC__" -} -post-messages: [ - "A failure in the middle of the build may be caused by build parallelism - (enabled by default). - Please file a bug report at https://github.com/ocaml/opam-repository/issues" - {failure & jobs > 1} - "You can try installing again including --jobs=1 - to force a sequential build instead." - {failure & jobs > 1 & opam-version >= "2.0.5"} -] -conflicts: [ "ocaml-option-fp" "ocaml-option-msvc" ] -depopts: [ - "ocaml-option-32bit" - "ocaml-option-afl" - "ocaml-option-bytecode-only" - "ocaml-option-no-flat-float-array" - "ocaml-option-flambda" - "ocaml-option-musl" - "ocaml-option-leak-sanitizer" - "ocaml-option-address-sanitizer" - "ocaml-option-static" - "ocaml-option-mingw" - # TODO: the full behaviour for Cygwin _should_ be that if the Cygwin flexdll is installed and opam's flexdll is not requested, - # then use it; if Cygwin's flexdll is _not_ installed then the opam flexdll package should be pulled in (4.13+) or the - # depext system should cause flexdll to be installed (4.12 and earlier). If opam's flexdll is explicitly requested, then - # OCaml should recompile with it. - "flexdll" -] -available: os = "win32" | os = "cygwin" diff --git a/.github/runner.sh b/.github/runner.sh new file mode 100755 index 000000000..519975e7d --- /dev/null +++ b/.github/runner.sh @@ -0,0 +1,211 @@ +#!/bin/sh + +set -e + +OCAMLDIR=ocaml +DUNEDIR=dune +MULTICORETESTSDIR=multicoretests + +fatal() { + printf %s "$1" + exit 1 +} + +compiler_sha() { + # Expect $COMPILER_REPO and $COMPILER_REF to be set + # Note: only GitHub-hosted compiler forks are supported for now + git ls-remote "https://github.com/$COMPILER_REPO.git" "$COMPILER_REF" \ + | cut -f 1 +} + +setup() { + if [ -n "$GITHUB_ENV" ] && [ -n "$GITHUB_PATH" ] ; then + sha="$(compiler_sha)" || fatal "Cannot find compiler's SHA" + arch="$(uname -m)" + opts="$(printf %s "$OCAML_OPTIONS" | tr " " -)" + opts="${opts:+-}$opts" + echo "cache_key=ocaml-$sha-$OCAML_PLATFORM-$arch$opts" >> "$GITHUB_ENV" + case "$OCAML_PLATFORM" in + mingw|msvc|cygwin) + PREFIX='D:\ocaml' + bin='D:\ocaml\bin' + ;; + *) + PREFIX="$HOME/local" + bin="$HOME/local/bin" + ;; + esac + printf "PREFIX=%s\n" "$PREFIX" >> "$GITHUB_ENV" + printf "%s\n" "$bin" >> "$GITHUB_PATH" + if [ -z "$JOBS" ] ; then + if command -v nproc > /dev/null; then + echo "JOBS=$(nproc)" >> "$GITHUB_ENV" + elif command -v sysctl > /dev/null; then + echo "JOBS=$(sysctl -n hw.ncpu)" >> "$GITHUB_ENV" + fi + fi + + echo Environment set up: + cat "$GITHUB_ENV" + echo PATH addition: + cat "$GITHUB_PATH" + fi + + case "$OCAML_PLATFORM,$OCAML_OPTIONS" in + linux,*32bit*) + sudo dpkg --add-architecture i386 + sudo apt-get update + sudo apt-get install pkg-config:i386 libzstd1:i386 libzstd-dev:i386 \ + libgcc-s1:i386 gcc-multilib g++-multilib + ;; + esac +} + +build_ocaml() { + echo "${LOGBEGINGRP}Building OCaml" + # We let standard OCaml CI test for warnings + opts="--disable-warn-error \ + --disable-stdlib-manpages \ + --disable-ocamltest \ + --disable-ocamldoc" + case "$OCAML_OPTIONS" in + *fp*) + opts="$opts --enable-frame-pointers" + ;; + esac + case "$OCAML_OPTIONS" in + *bytecode-only*) + opts="$opts --disable-native-compiler" + ;; + esac + case "$OCAML_PLATFORM" in + msvc|mingw|cygwin) + opts="$opts --prefix=/cygdrive/d/ocaml" + ;; + *) + opts="$opts --prefix=$PREFIX" + ;; + esac + + cd "$OCAMLDIR" + case "$OCAML_PLATFORM,$OCAML_OPTIONS" in + msvc,*32bit*) + eval $(tools/msvs-promote-path) + printf 'Running: %s\n' "./configure --host=i686-pc-windows $opts" + if ! ./configure --host=i686-pc-windows $opts ; then + cat config.log + exit 1 + fi + ;; + msvc,*) + eval $(tools/msvs-promote-path) + printf 'Running: %s\n' "./configure --host=x86_64-pc-windows $opts" + if ! ./configure --host=x86_64-pc-windows $opts ; then + cat config.log + exit 1 + fi + ;; + mingw,*) + printf 'Running: %s\n' "./configure --host=x86_64-w64-mingw32 $opts" + if ! ./configure --host=x86_64-w64-mingw32 $opts ; then + cat config.log + exit 1 + fi + ;; + cygwin,*) + case $COMPILER_REF in + */5.1*) + git -C flexdll fetch origin 0.43 + git -C flexdll checkout FETCH_HEAD + ;; + esac + + printf 'Running: %s\n' "./configure $opts" + if ! ./configure $opts ; then + cat config.log + exit 1 + fi + ;; + linux,*32bit*) + printf 'Running: %s\n' \ + "./configure --host=i386-linux \"CC=gcc -m32\" $opts" + if ! ./configure --host=i386-linux "CC=gcc -m32" $opts ; then + cat config.log + exit 1 + fi + ;; + *) # linux, macos, default options + printf 'Running: %s\n' "./configure $opts" + if ! ./configure $opts ; then + cat config.log + exit 1 + fi + ;; + esac + + make -j"$JOBS" + make install + + echo "$LOGENDGRP" +} + +build_dune() { + echo "${LOGBEGINGRP}Building dune" + case "$OCAML_PLATFORM" in + msvc) + eval $("$OCAMLDIR"/tools/msvs-promote-path) + ;; + esac + + cd "$DUNEDIR" + make release + make install PREFIX="$PREFIX" + echo "$LOGENDGRP" +} + +show_config() { + set -x + ocamlc -config + dune --version +} + +build_testsuite() { + case "$OCAML_PLATFORM" in + msvc) + eval $("$OCAMLDIR"/tools/msvs-promote-path) + ;; + esac + + cd "$MULTICORETESTSDIR" + dune build + dune build test/ +} + +case "$1" in + setup) + setup + ;; + ocaml) + build_ocaml + ;; + dune) + build_dune + ;; + show_config) + show_config + ;; + build) + build_testsuite + ;; + testsuite) + cd "$MULTICORETESTSDIR" + dune build @ci -j1 --no-buffer --display=quiet --cache=disabled --error-reporting=twice + ;; + internaltests) + cd "$MULTICORETESTSDIR" + dune runtest -j1 --no-buffer --display=quiet --cache=disabled --error-reporting=twice test/ + ;; + *) + fatal "Unknown command '$1'" + ;; +esac diff --git a/.github/workflows/common.yml b/.github/workflows/common.yml index 15157a2f3..939a75e12 100644 --- a/.github/workflows/common.yml +++ b/.github/workflows/common.yml @@ -11,11 +11,16 @@ on: description: 'Type of machine + OS on which to run the tests' type: string default: 'ubuntu-latest' - cygwin: - description: > - Whether Cygwin should be used on Windows - type: boolean - default: false + options: + description: >- + Configuration options for the compiler. + Space-separated list of '32bit', 'bytecode-only', 'fp'. + type: string + default: '' + platform: + description: 'Platform. One of: linux, macos, msvc, mingw, cygwin.' + type: string + default: 'linux' timeout: description: 'Timeout' type: number @@ -32,249 +37,128 @@ on: description: 'dune alias that should be built in the main step' type: string default: 'runtest' - compiler: - description: 'Compiler to use' - type: string - default: 'ocaml-base-compiler.5.0.0' - compiler_commit: - description: 'Version (commit) of the OCaml compiler to use' - type: string - default: '' - compiler_git_ref: - description: | - Git ref (such as "refs/heads/trunk") of the compiler, to set up caching properly when "compiler" is not a unique identifier - This ref will be looked up in the upstream "ocaml/ocaml" github repository + compiler_repository: + description: 'Repository from which to fetch the compiler' type: string - default: '' - custom_compiler_version: - description: | - Version number of the custom OCaml compiler to install (eg 5.1.0+gite4954296e68) - This version number will be used by setup-ocaml in its cache key so, if it identifies a precise commit, `compiler_git_ref` can be empty - type: string - default: '' - custom_compiler_src: - description: | - Source (URL) of the custom OCaml compiler to install (eg https://github.com/ocaml/ocaml/archive/e4954296e68.tar.gz) - Must be set if custom_compiler_version is - type: string - default: '' - custom_ocaml_package_version: - description: | - Version number of the OCaml OPAM package to use - Defaults to custom_compiler_version chunked at [+~-] + default: 'ocaml/ocaml' + compiler_ref: + description: 'Git reference to use' type: string - default: '' + required: true + +permissions: {} jobs: test: env: QCHECK_MSG_INTERVAL: '60' + OCAML_OPTIONS: ${{ inputs.options }} + OCAML_PLATFORM: ${{ inputs.platform }} DUNE_PROFILE: ${{ inputs.dune_profile }} OCAMLRUNPARAM: ${{ inputs.runparam }} DUNE_CI_ALIAS: ${{ inputs.dune_alias }} - COMPILER: ${{ inputs.compiler }} - OCAML_COMPILER_GIT_REF: ${{ inputs.compiler_git_ref }} - CUSTOM_COMPILER_VERSION: ${{ inputs.custom_compiler_version }} - CUSTOM_COMPILER_SRC: ${{ inputs.custom_compiler_src }} - CUSTOM_OCAML_PKG_VERSION: ${{ inputs.custom_ocaml_package_version }} + COMPILER_REPO: ${{ inputs.compiler_repository }} + COMPILER_REF: ${{ inputs.compiler_ref }} + LOGBEGINGRP: "::group::" + LOGENDGRP: "::endgroup::" - # For the record, here is how to set up the environment to test - # a PR-version of the compiler - # OCAML_COMPILER_GIT_REF: 'refs/pull/12345/head' - # CUSTOM_COMPILER_VERSION: '5.1.0+pr12345' - # CUSTOM_COMPILER_SRC: 'https://github.com/ocaml/ocaml/archive/refs/pull/12345/head.tar.gz' + # For the record, PR 12345 of the compiler can be tested simply by setting + # COMPILER_REF: 'refs/pull/12345/head' runs-on: ${{ inputs.runs_on }} timeout-minutes: ${{ inputs.timeout }} steps: - - name: Configure environment (Cygwin) + - 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 - - # Set up OPAM environment variables for the particular - # Cygwin case - echo OPAMYES=1 >> $env:GITHUB_ENV - echo OPAMROOT=/cygdrive/d/opam >> $env:GITHUB_ENV - if: "runner.os == 'Windows' && inputs.cygwin" + if: inputs.platform == 'cygwin' - name: Checkout code uses: actions/checkout@v4 - - - name: Pre-setup ($PATH, cache prefix, custom OPAM package for the compiler) - id: presetup - shell: bash - run: | - if [ "${COMPILER##*32bit}" = "" ]; then - sudo dpkg --add-architecture i386 - sudo apt-get update - sudo apt-get install pkg-config:i386 libzstd1:i386 libzstd-dev:i386 libgcc-s1:i386 - fi - - # Generate an OPAM config for a custom compiler - if [ -n "$CUSTOM_COMPILER_VERSION" ]; then - if [ -z "$CUSTOM_COMPILER_SRC" ]; then - echo '::error title=$CUSTOM_COMPILER_SRC not set::$CUSTOM_COMPILER_SRC must be set whenever $CUSTOM_COMPILER_VERSION is' - exit 1 - fi - if [ -z "$CUSTOM_OCAML_PKG_VERSION" ]; then - CUSTOM_OCAML_PKG_VERSION="${CUSTOM_COMPILER_VERSION%%[~+-]*}" - fi - if [ "$RUNNER_OS" = "Windows" ]; then - OPAMTEMPLATE=.github/opam/ocaml-variants.opam.windows - else - OPAMTEMPLATE=.github/opam/ocaml-variants.opam.unix - fi - OPAMDIR=".github/opam/custom/packages/ocaml-variants/ocaml-variants.$CUSTOM_COMPILER_VERSION" - mkdir -p "$OPAMDIR" - awk -v compiler="$CUSTOM_COMPILER_VERSION" \ - -v compilersrc="$CUSTOM_COMPILER_SRC" \ - -v ocamlpkg="$CUSTOM_OCAML_PKG_VERSION" \ - '{ sub("__OCAML_COMPILER_FULL_VERSION__", compiler); \ - sub("__OCAML_COMPILER_SRC__", compilersrc); \ - sub("__OCAML_OPAM_PACKAGE_VERSION__", ocamlpkg); \ - print }' < $OPAMTEMPLATE \ - > "$OPAMDIR/opam" - echo Generated OPAM package configuration: - echo ------------------------------------------------ - cat "$OPAMDIR/opam" - echo ------------------------------------------------ - - # Reset $COMPILER keeping the options - if [ "${COMPILER##*,*}" "=" "$COMPILER" ]; - then OPTS=""; - else OPTS=",${COMPILER#*,}"; - fi - echo "COMPILER=ocaml-variants.$CUSTOM_COMPILER_VERSION$OPTS" >> "$GITHUB_ENV" - cat "$GITHUB_ENV" - fi - - # Pick up a robust cache prefix - if [ -n "$OCAML_COMPILER_GIT_REF" ]; then - cache_prefix="$(git ls-remote https://github.com/ocaml/ocaml.git "$OCAML_COMPILER_GIT_REF" | cut -f 1 | head -n 1)" - else - cache_prefix=v1 - fi - echo "cache_prefix=$cache_prefix" >> "$GITHUB_OUTPUT" - cat "$GITHUB_OUTPUT" - - # Save pristine PATH for cache action (Cygwin messes it up) - echo "cache_path=$PATH" >> "$GITHUB_OUTPUT" - - - name: Install OCaml compiler ${{ env.COMPILER }} (Linux / macOS) - uses: ocaml/setup-ocaml@v2 with: - ocaml-compiler: ${{ env.COMPILER }} - opam-repositories: | - local: file://${{ github.workspace }}/.github/opam/custom - default: https://github.com/ocaml/opam-repository.git - override: https://github.com/shym/custom-opam-repository.git - opam-depext: false - dune-cache: true - cache-prefix: ${{ steps.presetup.outputs.cache_prefix }} - if: runner.os != 'Windows' + path: multicoretests - - name: Install OCaml compiler ${{ env.COMPILER }} (Windows) - uses: ocaml/setup-ocaml@v2 + - name: Fetch QCheck + uses: actions/checkout@v4 with: - ocaml-compiler: ${{ env.COMPILER }} - opam-repositories: | - local: ${{ github.workspace }}\.github\opam\custom - dra27: https://github.com/dra27/opam-repository.git#windows-5.0 - override: https://github.com/shym/custom-opam-repository.git - default: https://github.com/ocaml-opam/opam-repository-mingw.git#sunset - upstream: https://github.com/ocaml/opam-repository.git - opam-depext: false - cache-prefix: ${{ steps.presetup.outputs.cache_prefix }} - if: "runner.os == 'Windows' && !inputs.cygwin" + repository: c-cube/qcheck + ref: v0.22 + path: multicoretests/qcheck - - name: Restore Cygwin packages (Cygwin) - uses: actions/cache/restore@v3 - id: cache_cygwin - env: - PATH: ${{ steps.presetup.outputs.cache_path }} + - name: Pre-Setup + run: | + bash multicoretests/.github/runner.sh setup + + - name: Set up MSVC + uses: ilammy/msvc-dev-cmd@v1 + if: inputs.platform == 'msvc' + + - name: Restore cache + uses: actions/cache/restore@v4 + id: cache with: path: | + ${{ env.PREFIX }} C:\cygwin-packages - key: cygwin-packages-opam-2.0.7-1 - if: "runner.os == 'Windows' && inputs.cygwin" + key: ${{ env.cache_key }} - - name: Install Cygwin (in particular OPAM) (Cygwin) + - name: Install Cygwin (Windows only) uses: cygwin/cygwin-install-action@v4 with: - packages: opam + packages: make,bash${{ inputs.platform == 'mingw' && ',mingw64-x86_64-gcc-core,mingw64-x86_64-gcc-g++' || '' }}${{ inputs.platform == 'cygwin' && ',gcc-core' }} install-dir: 'D:\cygwin' - if: "runner.os == 'Windows' && inputs.cygwin" + if: runner.os == 'Windows' - - name: Save Cygwin packages (Cygwin) - uses: actions/cache/save@v3 - env: - PATH: ${{ steps.presetup.outputs.cache_path }} + - name: Fetch OCaml + uses: actions/checkout@v4 with: - path: | - C:\cygwin-packages - key: cygwin-packages-opam-2.0.7-1 - if: "runner.os == 'Windows' && inputs.cygwin && steps.cache_cygwin.outputs.cache-hit != 'true'" - - - name: Restore OPAM state (Cygwin) - uses: actions/cache/restore@v3 - id: cache_opam - env: - PATH: ${{ steps.presetup.outputs.cache_path }} + repository: ${{ env.COMPILER_REPO }} + ref: ${{ env.COMPILER_REF }} + path: ocaml + submodules: true + if: steps.cache.outputs.cache-hit != 'true' || inputs.platform == 'msvc' + # We need to fetch OCaml in all cases for MSVC for msvs-promote-path + + - name: Fetch dune + uses: actions/checkout@v4 with: - path: | - D:\opam - key: ${{ steps.presetup.outputs.cache_prefix }}-cygwin-opam-${{ env.COMPILER }} - if: "runner.os == 'Windows' && inputs.cygwin" - - - name: Install OCaml compiler ${{ env.COMPILER }} (Cygwin) - run: | - opam init --disable-sandboxing --auto-setup --bare - opam repository add --all main "https://github.com/ocaml/opam-repository.git" - opam repository add --all windows "https://github.com/ocaml-opam/opam-repository-mingw.git#sunset" - opam repository add --all override "https://github.com/shym/custom-opam-repository.git" - 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 && steps.cache_opam.outputs.cache-hit != 'true'" + repository: ocaml/dune + ref: 3.16.0 + path: dune + if: steps.cache.outputs.cache-hit != 'true' - - name: Set up macOS environment ($OPAMJOBS) - if: runner.os == 'macOS' + - name: Build and install OCaml and dune run: | - echo "OPAMJOBS=1" >> $GITHUB_ENV + bash multicoretests/.github/runner.sh ocaml + bash multicoretests/.github/runner.sh dune + if: steps.cache.outputs.cache-hit != 'true' - - name: Install Multicore Tests dependencies - run: | - opam install . --deps-only --with-test - - - name: Show configuration and clean up - run: | - opam exec -- ocamlc -config - opam config list - opam exec -- dune printenv - opam list --columns=name,installed-version,repository,synopsis-or-target - opam clean --all-switches --unused-repositories --logs --download-cache --repo-cache - - - name: Save OPAM state (Cygwin) - uses: actions/cache/save@v3 - env: - PATH: ${{ steps.presetup.outputs.cache_path }} + - name: Save cache + uses: actions/cache/save@v4 with: path: | - D:\opam - key: ${{ steps.presetup.outputs.cache_prefix }}-cygwin-opam-${{ env.COMPILER }} - if: "runner.os == 'Windows' && inputs.cygwin" + ${{ env.PREFIX }} + C:\cygwin-packages + key: ${{ env.cache_key }} + if: steps.cache.outputs.cache-hit != 'true' + + - name: Show the configuration + run: | + bash multicoretests/.github/runner.sh show_config - name: Build the test suite - run: opam exec -- dune build + run: | + bash multicoretests/.github/runner.sh build - name: Run the internal package tests - run: opam exec -- dune runtest -j1 --no-buffer --display=quiet --cache=disabled --error-reporting=twice test/ + run: | + bash multicoretests/.github/runner.sh internaltests - name: Run the multicore test suite - id: mainstep - run: opam exec -- dune build "@ci" -j1 --no-buffer --display=quiet --cache=disabled --error-reporting=twice + run: | + bash multicoretests/.github/runner.sh testsuite diff --git a/.github/workflows/cygwin-51x.yml b/.github/workflows/cygwin-51x.yml index df8c6b4c6..596b58a6e 100644 --- a/.github/workflows/cygwin-51x.yml +++ b/.github/workflows/cygwin-51x.yml @@ -11,6 +11,6 @@ jobs: uses: ./.github/workflows/common.yml with: runs_on: windows-latest - compiler: ocaml-variants.5.1.1+options+win - cygwin: true + platform: cygwin + compiler_ref: refs/tags/5.1.1 timeout: 240 diff --git a/.github/workflows/cygwin-520.yml b/.github/workflows/cygwin-520.yml index 90cafc597..76d3fa87c 100644 --- a/.github/workflows/cygwin-520.yml +++ b/.github/workflows/cygwin-520.yml @@ -15,6 +15,6 @@ jobs: uses: ./.github/workflows/common.yml with: runs_on: windows-latest - compiler: ocaml-variants.5.2.0+options+win - cygwin: true + platform: cygwin + compiler_ref: refs/tags/5.2.0 timeout: 240 diff --git a/.github/workflows/cygwin-530-trunk.yml b/.github/workflows/cygwin-530-trunk.yml index b1b7afd82..9d39a3ba0 100644 --- a/.github/workflows/cygwin-530-trunk.yml +++ b/.github/workflows/cygwin-530-trunk.yml @@ -15,7 +15,6 @@ jobs: uses: ./.github/workflows/common.yml with: runs_on: windows-latest - compiler: ocaml.5.3.0 - cygwin: true - compiler_git_ref: refs/heads/5.3 + platform: cygwin + compiler_ref: refs/heads/5.3 timeout: 240 diff --git a/.github/workflows/cygwin-540-trunk.yml b/.github/workflows/cygwin-540-trunk.yml index b7dd62c01..5de27f4d2 100644 --- a/.github/workflows/cygwin-540-trunk.yml +++ b/.github/workflows/cygwin-540-trunk.yml @@ -15,7 +15,6 @@ jobs: uses: ./.github/workflows/common.yml with: runs_on: windows-latest - compiler: ocaml.5.4.0 - cygwin: true - compiler_git_ref: refs/heads/trunk + platform: cygwin + compiler_ref: refs/heads/trunk timeout: 240 diff --git a/.github/workflows/linux-500-32bit.yml b/.github/workflows/linux-500-32bit.yml index 86587a258..2d2069e84 100644 --- a/.github/workflows/linux-500-32bit.yml +++ b/.github/workflows/linux-500-32bit.yml @@ -10,5 +10,6 @@ jobs: build: uses: ./.github/workflows/common.yml with: - compiler: 'ocaml-variants.5.0.0+options,ocaml-option-32bit' + compiler_ref: refs/tags/5.0.0 + options: 32bit timeout: 240 diff --git a/.github/workflows/linux-500-bytecode.yml b/.github/workflows/linux-500-bytecode.yml index 1014e55d2..ff822129b 100644 --- a/.github/workflows/linux-500-bytecode.yml +++ b/.github/workflows/linux-500-bytecode.yml @@ -10,5 +10,6 @@ jobs: build: uses: ./.github/workflows/common.yml with: - compiler: 'ocaml-variants.5.0.0+options,ocaml-option-bytecode-only' + compiler_ref: refs/tags/5.0.0 + options: bytecode-only timeout: 240 diff --git a/.github/workflows/linux-500-debug.yml b/.github/workflows/linux-500-debug.yml index 7d1306088..4671b67a1 100644 --- a/.github/workflows/linux-500-debug.yml +++ b/.github/workflows/linux-500-debug.yml @@ -10,6 +10,7 @@ jobs: build: uses: ./.github/workflows/common.yml with: + compiler_ref: refs/tags/5.0.0 dune_profile: 'debug-runtime' runparam: 's=4096,v=0,V=1' timeout: 240 diff --git a/.github/workflows/linux-500.yml b/.github/workflows/linux-500.yml index d490668b3..8049e76bb 100644 --- a/.github/workflows/linux-500.yml +++ b/.github/workflows/linux-500.yml @@ -9,4 +9,5 @@ on: jobs: build: uses: ./.github/workflows/common.yml - # default + with: + compiler_ref: refs/tags/5.0.0 diff --git a/.github/workflows/linux-51x-32bit.yml b/.github/workflows/linux-51x-32bit.yml index 160f441c9..576125172 100644 --- a/.github/workflows/linux-51x-32bit.yml +++ b/.github/workflows/linux-51x-32bit.yml @@ -10,5 +10,6 @@ jobs: build: uses: ./.github/workflows/common.yml with: - compiler: 'ocaml-variants.5.1.1+options,ocaml-option-32bit' + compiler_ref: refs/tags/5.1.1 + options: 32bit timeout: 240 diff --git a/.github/workflows/linux-51x-bytecode.yml b/.github/workflows/linux-51x-bytecode.yml index 83532df3c..fd77fa382 100644 --- a/.github/workflows/linux-51x-bytecode.yml +++ b/.github/workflows/linux-51x-bytecode.yml @@ -10,5 +10,6 @@ jobs: build: uses: ./.github/workflows/common.yml with: - compiler: 'ocaml-variants.5.1.1+options,ocaml-option-bytecode-only' + compiler_ref: refs/tags/5.1.1 + options: bytecode-only timeout: 240 diff --git a/.github/workflows/linux-51x-debug.yml b/.github/workflows/linux-51x-debug.yml index 5a0ae1591..ab29d0b8f 100644 --- a/.github/workflows/linux-51x-debug.yml +++ b/.github/workflows/linux-51x-debug.yml @@ -10,7 +10,7 @@ jobs: build: uses: ./.github/workflows/common.yml with: - compiler: 'ocaml-base-compiler.5.1.1' + compiler_ref: refs/tags/5.1.1 dune_profile: 'debug-runtime' runparam: 's=4096,v=0,V=1' timeout: 240 diff --git a/.github/workflows/linux-51x-fp.yml b/.github/workflows/linux-51x-fp.yml index c98fc25eb..2cf1460a6 100644 --- a/.github/workflows/linux-51x-fp.yml +++ b/.github/workflows/linux-51x-fp.yml @@ -10,5 +10,6 @@ jobs: build: uses: ./.github/workflows/common.yml with: - compiler: 'ocaml-variants.5.1.1+options,ocaml-option-fp' + compiler_ref: refs/tags/5.1.1 + options: fp timeout: 240 diff --git a/.github/workflows/linux-51x.yml b/.github/workflows/linux-51x.yml index bcc5624f6..81b9191b8 100644 --- a/.github/workflows/linux-51x.yml +++ b/.github/workflows/linux-51x.yml @@ -10,4 +10,4 @@ jobs: build: uses: ./.github/workflows/common.yml with: - compiler: 'ocaml-base-compiler.5.1.1' + compiler_ref: refs/tags/5.1.1 diff --git a/.github/workflows/linux-520-32bit.yml b/.github/workflows/linux-520-32bit.yml index 76bf62b1f..0d5de1c81 100644 --- a/.github/workflows/linux-520-32bit.yml +++ b/.github/workflows/linux-520-32bit.yml @@ -14,5 +14,6 @@ jobs: build: uses: ./.github/workflows/common.yml with: - compiler: 'ocaml-variants.5.2.0+options,ocaml-option-32bit' + compiler_ref: refs/tags/5.2.0 + options: 32bit timeout: 240 diff --git a/.github/workflows/linux-520-bytecode.yml b/.github/workflows/linux-520-bytecode.yml index 564b1592a..91d43fcdd 100644 --- a/.github/workflows/linux-520-bytecode.yml +++ b/.github/workflows/linux-520-bytecode.yml @@ -14,5 +14,6 @@ jobs: build: uses: ./.github/workflows/common.yml with: - compiler: 'ocaml-variants.5.2.0+options,ocaml-option-bytecode-only' + compiler_ref: refs/tags/5.2.0 + options: bytecode-only timeout: 240 diff --git a/.github/workflows/linux-520-debug.yml b/.github/workflows/linux-520-debug.yml index feb3da1df..757b3fedd 100644 --- a/.github/workflows/linux-520-debug.yml +++ b/.github/workflows/linux-520-debug.yml @@ -14,7 +14,7 @@ jobs: build: uses: ./.github/workflows/common.yml with: - compiler: 'ocaml-base-compiler.5.2.0' + compiler_ref: refs/tags/5.2.0 dune_profile: 'debug-runtime' runparam: 's=4096,v=0,V=1' timeout: 240 diff --git a/.github/workflows/linux-520-fp.yml b/.github/workflows/linux-520-fp.yml index 78e7b1608..81762da6a 100644 --- a/.github/workflows/linux-520-fp.yml +++ b/.github/workflows/linux-520-fp.yml @@ -14,5 +14,6 @@ jobs: build: uses: ./.github/workflows/common.yml with: - compiler: 'ocaml-variants.5.2.0+options,ocaml-option-fp' + compiler_ref: refs/tags/5.2.0 + options: fp timeout: 240 diff --git a/.github/workflows/linux-520.yml b/.github/workflows/linux-520.yml index 026a0d4f6..5209c98b8 100644 --- a/.github/workflows/linux-520.yml +++ b/.github/workflows/linux-520.yml @@ -14,4 +14,4 @@ jobs: build: uses: ./.github/workflows/common.yml with: - compiler: 'ocaml-base-compiler.5.2.0' + compiler_ref: refs/tags/5.2.0 diff --git a/.github/workflows/linux-530-trunk-32bit.yml b/.github/workflows/linux-530-trunk-32bit.yml index 40923a75e..b5158862c 100644 --- a/.github/workflows/linux-530-trunk-32bit.yml +++ b/.github/workflows/linux-530-trunk-32bit.yml @@ -14,6 +14,6 @@ jobs: build: uses: ./.github/workflows/common.yml with: - compiler: 'ocaml-variants.5.3.0+trunk,ocaml-option-32bit' - compiler_git_ref: refs/heads/5.3 + compiler_ref: refs/heads/5.3 + options: 32bit timeout: 240 diff --git a/.github/workflows/linux-530-trunk-bytecode.yml b/.github/workflows/linux-530-trunk-bytecode.yml index 5c696692e..90c056683 100644 --- a/.github/workflows/linux-530-trunk-bytecode.yml +++ b/.github/workflows/linux-530-trunk-bytecode.yml @@ -14,6 +14,6 @@ jobs: build: uses: ./.github/workflows/common.yml with: - compiler: 'ocaml-variants.5.3.0+trunk,ocaml-option-bytecode-only' - compiler_git_ref: refs/heads/5.3 + compiler_ref: refs/heads/5.3 + options: bytecode-only timeout: 240 diff --git a/.github/workflows/linux-530-trunk-debug.yml b/.github/workflows/linux-530-trunk-debug.yml index 5c7a2d29e..78c6b32cd 100644 --- a/.github/workflows/linux-530-trunk-debug.yml +++ b/.github/workflows/linux-530-trunk-debug.yml @@ -14,8 +14,7 @@ jobs: build: uses: ./.github/workflows/common.yml with: - compiler: 'ocaml-variants.5.3.0+trunk' - compiler_git_ref: refs/heads/5.3 + compiler_ref: refs/heads/5.3 dune_profile: 'debug-runtime' runparam: 's=4096,v=0,V=1' timeout: 240 diff --git a/.github/workflows/linux-530-trunk-fp.yml b/.github/workflows/linux-530-trunk-fp.yml index 3c52e7208..3faf669c7 100644 --- a/.github/workflows/linux-530-trunk-fp.yml +++ b/.github/workflows/linux-530-trunk-fp.yml @@ -14,6 +14,6 @@ jobs: build: uses: ./.github/workflows/common.yml with: - compiler: 'ocaml-variants.5.3.0+trunk,ocaml-option-fp' - compiler_git_ref: refs/heads/5.3 + compiler_ref: refs/heads/5.3 + options: fp timeout: 240 diff --git a/.github/workflows/linux-530-trunk.yml b/.github/workflows/linux-530-trunk.yml index 01c657076..26f4820ac 100644 --- a/.github/workflows/linux-530-trunk.yml +++ b/.github/workflows/linux-530-trunk.yml @@ -14,5 +14,4 @@ jobs: build: uses: ./.github/workflows/common.yml with: - compiler: 'ocaml-variants.5.3.0+trunk' - compiler_git_ref: refs/heads/5.3 + compiler_ref: refs/heads/5.3 diff --git a/.github/workflows/linux-540-trunk-32bit.yml b/.github/workflows/linux-540-trunk-32bit.yml index 455b38e96..d8b367b25 100644 --- a/.github/workflows/linux-540-trunk-32bit.yml +++ b/.github/workflows/linux-540-trunk-32bit.yml @@ -14,6 +14,6 @@ jobs: build: uses: ./.github/workflows/common.yml with: - compiler: 'ocaml-variants.5.4.0+trunk,ocaml-option-32bit' - compiler_git_ref: refs/heads/trunk + compiler_ref: refs/heads/trunk + options: 32bit timeout: 240 diff --git a/.github/workflows/linux-540-trunk-bytecode.yml b/.github/workflows/linux-540-trunk-bytecode.yml index 216a795b7..76bea3e5b 100644 --- a/.github/workflows/linux-540-trunk-bytecode.yml +++ b/.github/workflows/linux-540-trunk-bytecode.yml @@ -14,6 +14,6 @@ jobs: build: uses: ./.github/workflows/common.yml with: - compiler: 'ocaml-variants.5.4.0+trunk,ocaml-option-bytecode-only' - compiler_git_ref: refs/heads/trunk + compiler_ref: refs/heads/trunk + options: bytecode-only timeout: 240 diff --git a/.github/workflows/linux-540-trunk-debug.yml b/.github/workflows/linux-540-trunk-debug.yml index 2278edd5e..3f5877301 100644 --- a/.github/workflows/linux-540-trunk-debug.yml +++ b/.github/workflows/linux-540-trunk-debug.yml @@ -14,8 +14,7 @@ jobs: build: uses: ./.github/workflows/common.yml with: - compiler: 'ocaml-variants.5.4.0+trunk' - compiler_git_ref: refs/heads/trunk + compiler_ref: refs/heads/trunk dune_profile: 'debug-runtime' runparam: 's=4096,v=0,V=1' timeout: 240 diff --git a/.github/workflows/linux-540-trunk-fp.yml b/.github/workflows/linux-540-trunk-fp.yml index 1dc5760e0..9f12f9e1a 100644 --- a/.github/workflows/linux-540-trunk-fp.yml +++ b/.github/workflows/linux-540-trunk-fp.yml @@ -14,6 +14,6 @@ jobs: build: uses: ./.github/workflows/common.yml with: - compiler: 'ocaml-variants.5.4.0+trunk,ocaml-option-fp' - compiler_git_ref: refs/heads/trunk + compiler_ref: refs/heads/trunk + options: fp timeout: 240 diff --git a/.github/workflows/linux-540-trunk.yml b/.github/workflows/linux-540-trunk.yml index 1ddd3319f..5e429f04a 100644 --- a/.github/workflows/linux-540-trunk.yml +++ b/.github/workflows/linux-540-trunk.yml @@ -14,5 +14,4 @@ jobs: build: uses: ./.github/workflows/common.yml with: - compiler: 'ocaml-variants.5.4.0+trunk' - compiler_git_ref: refs/heads/trunk + compiler_ref: refs/heads/trunk diff --git a/.github/workflows/macosx-arm64-500.yml b/.github/workflows/macosx-arm64-500.yml index 6202766cd..65b33757e 100644 --- a/.github/workflows/macosx-arm64-500.yml +++ b/.github/workflows/macosx-arm64-500.yml @@ -11,3 +11,5 @@ jobs: uses: ./.github/workflows/common.yml with: runs_on: 'macos-14' + platform: macos + compiler_ref: refs/tags/5.0.0 diff --git a/.github/workflows/macosx-arm64-51x.yml b/.github/workflows/macosx-arm64-51x.yml index bfe137c7d..f5e33a392 100644 --- a/.github/workflows/macosx-arm64-51x.yml +++ b/.github/workflows/macosx-arm64-51x.yml @@ -10,5 +10,6 @@ jobs: build: uses: ./.github/workflows/common.yml with: - compiler: 'ocaml-base-compiler.5.1.1' runs_on: 'macos-14' + platform: macos + compiler_ref: refs/tags/5.1.1 diff --git a/.github/workflows/macosx-arm64-520.yml b/.github/workflows/macosx-arm64-520.yml index 040164dd7..a9446ac09 100644 --- a/.github/workflows/macosx-arm64-520.yml +++ b/.github/workflows/macosx-arm64-520.yml @@ -14,5 +14,6 @@ jobs: build: uses: ./.github/workflows/common.yml with: - compiler: 'ocaml-base-compiler.5.2.0' runs_on: 'macos-14' + platform: macos + compiler_ref: refs/tags/5.2.0 diff --git a/.github/workflows/macosx-arm64-530-trunk.yml b/.github/workflows/macosx-arm64-530-trunk.yml index c920d871a..86f466f01 100644 --- a/.github/workflows/macosx-arm64-530-trunk.yml +++ b/.github/workflows/macosx-arm64-530-trunk.yml @@ -14,6 +14,6 @@ jobs: build: uses: ./.github/workflows/common.yml with: - compiler: 'ocaml-variants.5.3.0+trunk' - compiler_git_ref: refs/heads/5.3 runs_on: 'macos-14' + platform: macos + compiler_ref: refs/heads/5.3 diff --git a/.github/workflows/macosx-arm64-540-trunk.yml b/.github/workflows/macosx-arm64-540-trunk.yml index dc4780fd5..ce405419e 100644 --- a/.github/workflows/macosx-arm64-540-trunk.yml +++ b/.github/workflows/macosx-arm64-540-trunk.yml @@ -14,6 +14,6 @@ jobs: build: uses: ./.github/workflows/common.yml with: - compiler: 'ocaml-variants.5.4.0+trunk' - compiler_git_ref: refs/heads/trunk runs_on: 'macos-14' + platform: macos + compiler_ref: refs/heads/trunk diff --git a/.github/workflows/macosx-intel-500.yml b/.github/workflows/macosx-intel-500.yml index 5adee673e..91ae3bbda 100644 --- a/.github/workflows/macosx-intel-500.yml +++ b/.github/workflows/macosx-intel-500.yml @@ -11,3 +11,5 @@ jobs: uses: ./.github/workflows/common.yml with: runs_on: 'macos-13' + platform: macos + compiler_ref: refs/tags/5.0.0 diff --git a/.github/workflows/macosx-intel-51x.yml b/.github/workflows/macosx-intel-51x.yml index 286cfea45..c54d72bc3 100644 --- a/.github/workflows/macosx-intel-51x.yml +++ b/.github/workflows/macosx-intel-51x.yml @@ -10,5 +10,6 @@ jobs: build: uses: ./.github/workflows/common.yml with: - compiler: 'ocaml-base-compiler.5.1.1' runs_on: 'macos-13' + platform: macos + compiler_ref: refs/tags/5.1.1 diff --git a/.github/workflows/macosx-intel-520.yml b/.github/workflows/macosx-intel-520.yml index 0ecb8c954..c16ef7b50 100644 --- a/.github/workflows/macosx-intel-520.yml +++ b/.github/workflows/macosx-intel-520.yml @@ -14,5 +14,6 @@ jobs: build: uses: ./.github/workflows/common.yml with: - compiler: 'ocaml-base-compiler.5.2.0' runs_on: 'macos-13' + platform: macos + compiler_ref: refs/tags/5.2.0 diff --git a/.github/workflows/macosx-intel-530-trunk.yml b/.github/workflows/macosx-intel-530-trunk.yml index 4a4117be2..8ae97bb56 100644 --- a/.github/workflows/macosx-intel-530-trunk.yml +++ b/.github/workflows/macosx-intel-530-trunk.yml @@ -14,6 +14,6 @@ jobs: build: uses: ./.github/workflows/common.yml with: - compiler: 'ocaml-variants.5.3.0+trunk' - compiler_git_ref: refs/heads/5.3 runs_on: 'macos-13' + platform: macos + compiler_ref: refs/heads/5.3 diff --git a/.github/workflows/macosx-intel-540-trunk.yml b/.github/workflows/macosx-intel-540-trunk.yml index 19207ce21..bbe4f3738 100644 --- a/.github/workflows/macosx-intel-540-trunk.yml +++ b/.github/workflows/macosx-intel-540-trunk.yml @@ -14,6 +14,6 @@ jobs: build: uses: ./.github/workflows/common.yml with: - compiler: 'ocaml-variants.5.4.0+trunk' - compiler_git_ref: refs/heads/trunk runs_on: 'macos-13' + platform: macos + compiler_ref: refs/heads/trunk diff --git a/.github/workflows/mingw-500-bytecode.yml b/.github/workflows/mingw-500-bytecode.yml index d7c2af561..feb56bfab 100644 --- a/.github/workflows/mingw-500-bytecode.yml +++ b/.github/workflows/mingw-500-bytecode.yml @@ -11,5 +11,7 @@ jobs: uses: ./.github/workflows/common.yml with: runs_on: windows-latest - compiler: ocaml.5.0.0,ocaml-option-mingw,ocaml-option-bytecode-only + platform: mingw + compiler_ref: refs/tags/5.0.0 + options: bytecode-only timeout: 240 diff --git a/.github/workflows/mingw-500.yml b/.github/workflows/mingw-500.yml index fa4280550..6a2846714 100644 --- a/.github/workflows/mingw-500.yml +++ b/.github/workflows/mingw-500.yml @@ -11,5 +11,6 @@ jobs: uses: ./.github/workflows/common.yml with: runs_on: windows-latest - compiler: ocaml.5.0.0,ocaml-option-mingw + platform: mingw + compiler_ref: refs/tags/5.0.0 timeout: 240 diff --git a/.github/workflows/mingw-51x-bytecode.yml b/.github/workflows/mingw-51x-bytecode.yml index bee386453..fc7601896 100644 --- a/.github/workflows/mingw-51x-bytecode.yml +++ b/.github/workflows/mingw-51x-bytecode.yml @@ -11,5 +11,7 @@ jobs: uses: ./.github/workflows/common.yml with: runs_on: windows-latest - compiler: ocaml-variants.5.1.1+options+win,ocaml-option-mingw,ocaml-option-bytecode-only + platform: mingw + compiler_ref: refs/tags/5.1.1 + options: bytecode-only timeout: 240 diff --git a/.github/workflows/mingw-51x.yml b/.github/workflows/mingw-51x.yml index ba83c6cb8..78bdc632c 100644 --- a/.github/workflows/mingw-51x.yml +++ b/.github/workflows/mingw-51x.yml @@ -11,5 +11,6 @@ jobs: uses: ./.github/workflows/common.yml with: runs_on: windows-latest - compiler: ocaml-variants.5.1.1+options+win,ocaml-option-mingw + platform: mingw + compiler_ref: refs/tags/5.1.1 timeout: 240 diff --git a/.github/workflows/mingw-520-bytecode.yml b/.github/workflows/mingw-520-bytecode.yml index 7afd758bf..07784d974 100644 --- a/.github/workflows/mingw-520-bytecode.yml +++ b/.github/workflows/mingw-520-bytecode.yml @@ -15,5 +15,7 @@ jobs: uses: ./.github/workflows/common.yml with: runs_on: windows-latest - compiler: ocaml-variants.5.2.0+options+win,ocaml-option-mingw,ocaml-option-bytecode-only + platform: mingw + compiler_ref: refs/tags/5.2.0 + options: bytecode-only timeout: 240 diff --git a/.github/workflows/mingw-520.yml b/.github/workflows/mingw-520.yml index 0ad27d86f..2f803c483 100644 --- a/.github/workflows/mingw-520.yml +++ b/.github/workflows/mingw-520.yml @@ -15,5 +15,6 @@ jobs: uses: ./.github/workflows/common.yml with: runs_on: windows-latest - compiler: ocaml-variants.5.2.0+options+win,ocaml-option-mingw + platform: mingw + compiler_ref: refs/tags/5.2.0 timeout: 240 diff --git a/.github/workflows/mingw-530-trunk-bytecode.yml b/.github/workflows/mingw-530-trunk-bytecode.yml index 8341cc386..753e21ca6 100644 --- a/.github/workflows/mingw-530-trunk-bytecode.yml +++ b/.github/workflows/mingw-530-trunk-bytecode.yml @@ -15,6 +15,7 @@ jobs: uses: ./.github/workflows/common.yml with: runs_on: windows-latest - compiler: ocaml.5.3.0,ocaml-option-mingw,ocaml-option-bytecode-only - compiler_git_ref: refs/heads/5.3 + platform: mingw + compiler_ref: refs/heads/5.3 + options: bytecode-only timeout: 240 diff --git a/.github/workflows/mingw-530-trunk.yml b/.github/workflows/mingw-530-trunk.yml index 22d580c79..bc3e675ff 100644 --- a/.github/workflows/mingw-530-trunk.yml +++ b/.github/workflows/mingw-530-trunk.yml @@ -15,6 +15,6 @@ jobs: uses: ./.github/workflows/common.yml with: runs_on: windows-latest - compiler: ocaml.5.3.0,ocaml-option-mingw - compiler_git_ref: refs/heads/5.3 + platform: mingw + compiler_ref: refs/heads/5.3 timeout: 240 diff --git a/.github/workflows/mingw-540-trunk-bytecode.yml b/.github/workflows/mingw-540-trunk-bytecode.yml index 6e95b96bf..fdb811dae 100644 --- a/.github/workflows/mingw-540-trunk-bytecode.yml +++ b/.github/workflows/mingw-540-trunk-bytecode.yml @@ -15,6 +15,7 @@ jobs: uses: ./.github/workflows/common.yml with: runs_on: windows-latest - compiler: ocaml.5.4.0,ocaml-option-mingw,ocaml-option-bytecode-only - compiler_git_ref: refs/heads/trunk + platform: mingw + compiler_ref: refs/heads/trunk + options: bytecode-only timeout: 240 diff --git a/.github/workflows/mingw-540-trunk.yml b/.github/workflows/mingw-540-trunk.yml index 82691698a..af3abfc6b 100644 --- a/.github/workflows/mingw-540-trunk.yml +++ b/.github/workflows/mingw-540-trunk.yml @@ -15,6 +15,6 @@ jobs: uses: ./.github/workflows/common.yml with: runs_on: windows-latest - compiler: ocaml.5.4.0,ocaml-option-mingw - compiler_git_ref: refs/heads/trunk + platform: mingw + compiler_ref: refs/heads/trunk timeout: 240 diff --git a/.github/workflows/msvc-530-trunk-bytecode.yml b/.github/workflows/msvc-530-trunk-bytecode.yml index 251738ed6..04916c726 100644 --- a/.github/workflows/msvc-530-trunk-bytecode.yml +++ b/.github/workflows/msvc-530-trunk-bytecode.yml @@ -12,7 +12,9 @@ on: jobs: build: - uses: ./.github/workflows/msvc-common.yml + uses: ./.github/workflows/common.yml with: - bytecodeonly: true - compiler_ref: '5.3' + runs_on: windows-latest + platform: msvc + compiler_ref: refs/heads/5.3 + options: bytecode-only diff --git a/.github/workflows/msvc-530-trunk.yml b/.github/workflows/msvc-530-trunk.yml index 24dda9ddd..c599ee866 100644 --- a/.github/workflows/msvc-530-trunk.yml +++ b/.github/workflows/msvc-530-trunk.yml @@ -12,6 +12,8 @@ on: jobs: build: - uses: ./.github/workflows/msvc-common.yml + uses: ./.github/workflows/common.yml with: - compiler_ref: '5.3' + runs_on: windows-latest + platform: msvc + compiler_ref: refs/heads/5.3 diff --git a/.github/workflows/msvc-540-trunk-bytecode.yml b/.github/workflows/msvc-540-trunk-bytecode.yml index 72be4d269..b32e1270d 100644 --- a/.github/workflows/msvc-540-trunk-bytecode.yml +++ b/.github/workflows/msvc-540-trunk-bytecode.yml @@ -12,7 +12,9 @@ on: jobs: build: - uses: ./.github/workflows/msvc-common.yml + uses: ./.github/workflows/common.yml with: - bytecodeonly: true - compiler_ref: 'trunk' + runs_on: windows-latest + platform: msvc + compiler_ref: refs/heads/trunk + options: bytecode-only diff --git a/.github/workflows/msvc-540-trunk.yml b/.github/workflows/msvc-540-trunk.yml index 018751b58..1d6ee614f 100644 --- a/.github/workflows/msvc-540-trunk.yml +++ b/.github/workflows/msvc-540-trunk.yml @@ -12,6 +12,8 @@ on: jobs: build: - uses: ./.github/workflows/msvc-common.yml + uses: ./.github/workflows/common.yml with: - compiler_ref: 'trunk' + runs_on: windows-latest + platform: msvc + compiler_ref: refs/heads/trunk diff --git a/.github/workflows/msvc-common.yml b/.github/workflows/msvc-common.yml deleted file mode 100644 index afc45fd57..000000000 --- a/.github/workflows/msvc-common.yml +++ /dev/null @@ -1,151 +0,0 @@ -name: Common MSVC CI workflow - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -on: - workflow_call: - inputs: - bytecodeonly: - type: boolean - default: false - dune_alias: - description: 'dune alias that should be built in the main step' - type: string - default: 'runtest' - compiler_ref: - description: | - Git ref (such as "trunk") of the compiler. - This ref will be used to checkout the relevant "ocaml/ocaml" github branch. - type: string - default: '' - - -jobs: - build: - permissions: {} - - runs-on: windows-latest - - steps: - - name: Save pristine PATH - id: pristine - run: | - echo "pristine_path=${env:Path}" >> "${env:GITHUB_OUTPUT}" - - - name: Set up MSVC - uses: ilammy/msvc-dev-cmd@v1 - - - name: Fetch OCaml - uses: actions/checkout@v4 - with: - repository: ocaml/ocaml - ref: ${{ inputs.compiler_ref }} - path: ocaml - submodules: true - - - name: Choose a cache key - id: key - env: - BC_KEY_PART: ${{ inputs.bytecodeonly && '-bytecode' || '' }} - run: | - git -C ocaml rev-parse HEAD | Tee-Object -Variable sha - echo "cache_key=ocaml-msvc${env:BC_KEY_PART}-${sha}" | Tee-Object -FilePath "${env:GITHUB_OUTPUT}" - - - name: Restore cache - uses: actions/cache/restore@v3 - id: cache - env: - PATH: ${{ steps.pristine.outputs.pristine_path }} - with: - path: | - C:\cygwin-packages - D:\ocaml - key: ${{ steps.key.outputs.cache_key }} - - - name: Install Cygwin (Cygwin) - uses: cygwin/cygwin-install-action@v3 - with: - packages: make,bash - install-dir: 'D:\cygwin' - - - name: Build OCaml - shell: bash -e {0} - env: - NATIVE: ${{ inputs.bytecodeonly && '--disable-native-compiler' || '' }} - run: | - cd ocaml # - mkdir /cygdrive/d/ocaml # - eval $(tools/msvs-promote-path) # - ./configure --host=x86_64-pc-windows --with-flexdll --prefix=/cygdrive/d/ocaml $NATIVE # - make # - make install # - if: "steps.cache.outputs.cache-hit != 'true'" - - - name: Fetch dune - uses: actions/checkout@v4 - with: - repository: ocaml/dune - path: dune - if: "steps.cache.outputs.cache-hit != 'true'" - - - name: Compile dune - shell: bash -e {0} - run: | - export PATH="/cygdrive/d/ocaml/bin:$PATH" # - eval $(ocaml/tools/msvs-promote-path) # - export INCLUDE="$INCLUDE;$(cygpath -w "$PWD/ocaml/runtime/winpthreads/include")" # - cd dune # - make release # - make install PREFIX='D:\ocaml' # - if: "steps.cache.outputs.cache-hit != 'true'" - - - name: Display configuration and set up PATH - run: | - D:\ocaml\bin\ocamlc -config - D:\ocaml\bin\dune --version - echo "D:\ocaml\bin" >> ${env:GITHUB_PATH} - - - name: Save cache - uses: actions/cache/save@v3 - env: - PATH: ${{ steps.pristine.outputs.pristine_path }} - with: - path: | - C:\cygwin-packages - D:\ocaml - key: ${{ steps.key.outputs.cache_key }} - if: "steps.cache.outputs.cache-hit != 'true'" - - - name: Fetch multicoretests - uses: actions/checkout@v4 - with: - path: mct - - - name: Fetch QCheck - uses: actions/checkout@v4 - with: - repository: c-cube/qcheck - path: mct/qcheck - - - name: Build the test suite - shell: bash -e {0} - run: | - eval $(ocaml/tools/msvs-promote-path) # - cd mct # - dune build # - dune build test/ # - - - name: Run the internal package tests - run: | - cd mct - dune runtest -j1 --no-buffer --display=quiet --cache=disabled --error-reporting=twice test/ - - - name: Run the multicore test suite - env: - QCHECK_MSG_INTERVAL: 60 - DUNE_CI_ALIAS: ${{ inputs.dune_alias }} - run: | - cd mct - dune build "@ci" -j1 --no-buffer --display=quiet --cache=disabled --error-reporting=twice diff --git a/README.md b/README.md index 5f641c20e..c036ae3aa 100644 --- a/README.md +++ b/README.md @@ -142,15 +142,13 @@ It is also possible to run the test suite in the CI, by altering [.github/workflows/common.yml](.github/workflows/common.yml) to target a particular compiler PR: ``` - OCAML_COMPILER_GIT_REF: 'refs/pull/12345/head' - CUSTOM_COMPILER_VERSION: '5.1.0+pr12345' - CUSTOM_COMPILER_SRC: 'https://github.com/ocaml/ocaml/archive/refs/pull/12345/head.tar.gz' + COMPILER_REF: 'refs/pull/12345/head' ``` -or a particular branch: +or a particular branch of a particular fork: ``` - CUSTOM_COMPILER_VERSION: '5.1.0+myexperiment' - CUSTOM_COMPILER_SRC: 'https://github.com/my_github_id/ocaml/archive/myexperiment-branch.tar.gz' + COMPILER_REPO: 'login/ocaml' + COMPILER_REF: 'refs/heads/test-me' ```