Skip to content
Open
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
4 changes: 2 additions & 2 deletions .github/scripts/cygwin.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ md %CYGWIN_ROOT%
:: Download the required setup program: the mingw-w64 compilers are only
:: installed with Cygwin64.
if "%1" equ "x86_64-pc-cygwin" (
curl -sLo %CYGWIN_ROOT%\setup.exe https://cygwin.com/setup-x86_64.exe
curl -fsSLo %CYGWIN_ROOT%\setup.exe https://cygwin.com/setup-x86_64.exe
set CYGWIN_PACKAGES=,mingw64-i686-gcc-core=14.3.0-0.1,mingw64-x86_64-gcc-core=14.3.0-0.1,mingw64-i686-gcc-g++=14.3.0-0.1,mingw64-x86_64-gcc-g++=14.3.0-0.1
) else (
curl -sLo %CYGWIN_ROOT%\setup.exe https://cygwin.com/setup-x86.exe
curl -fsSLo %CYGWIN_ROOT%\setup.exe https://cygwin.com/setup-x86.exe
set CYGWIN_PACKAGES=
)

Expand Down
13 changes: 7 additions & 6 deletions .github/scripts/main/ocaml-cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ esac
FLEXDLL_VERSION=0.44
MINGW_W64_VERSION=12.0.0

curl -sLO "https://github.com/ocaml/ocaml/archive/refs/tags/${OCAML_VERSION}.tar.gz"
curl -fsSLO "https://github.com/ocaml/ocaml/archive/refs/tags/${OCAML_VERSION}.tar.gz" || \
curl -fsSLO "https://github.com/ocaml/ocaml/archive/refs/heads/${OCAML_VERSION}.tar.gz"
if [[ $PLATFORM = 'Windows' ]] ; then
curl -sLO "https://github.com/ocaml/flexdll/archive/refs/tags/$FLEXDLL_VERSION.tar.gz"
curl -sLO "https://github.com/mingw-w64/mingw-w64/archive/refs/tags/v${MINGW_W64_VERSION}.tar.gz"
curl -fsSLO "https://github.com/ocaml/flexdll/archive/refs/tags/$FLEXDLL_VERSION.tar.gz"
curl -fsSLO "https://github.com/mingw-w64/mingw-w64/archive/refs/tags/v${MINGW_W64_VERSION}.tar.gz"
fi

tar -xzf "$OCAML_VERSION.tar.gz"
Expand All @@ -61,7 +62,7 @@ esac

cd "ocaml-$OCAML_VERSION"
for sha in $PATCHES; do
curl -sL "https://github.com/ocaml/ocaml/commit/$sha.patch" -o "../$sha.patch"
curl -fsSL "https://github.com/ocaml/ocaml/commit/$sha.patch" -o "../$sha.patch"
patch -p1 -i "../$sha.patch"
done

Expand Down Expand Up @@ -96,8 +97,8 @@ OCAML_BRANCH="${OCAML_BRANCH/./}"
if [[ $OPAM_TEST -ne 1 ]] ; then
if [[ -e configure.ac ]]; then
CONFIGURE_SWITCHES="--disable-debugger --disable-debug-runtime --disable-ocamldoc --disable-installing-bytecode-programs --disable-installing-source-artifacts"
if [[ $OCAML_BRANCH -eq 408 ]]; then
curl -L https://github.com/ocaml/ocaml/commit/c8ee39b320207717135d88cad67fb65d0901d6b6.patch -o pr8858.patch
if [[ $OCAML_BRANCH = 408 ]]; then
curl -fsSL https://github.com/ocaml/ocaml/commit/c8ee39b320207717135d88cad67fb65d0901d6b6.patch -o pr8858.patch
patch -p1 -i pr8858.patch
CONFIGURE_SWITCHES="$CONFIGURE_SWITCHES --disable-graph-lib"
fi
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/main/opam-bs-cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if [ "$os" = "darwin" ] ; then
os=macos
fi

curl -sL -o $OPAM_LOCAL/bin/opam-bootstrap \
curl -fsSL -o $OPAM_LOCAL/bin/opam-bootstrap \
"https://github.com/ocaml/opam/releases/download/$OPAMBSVERSION/opam-$OPAMBSVERSION-$(uname -m)-$os"
cp -f $OPAM_LOCAL/bin/opam-bootstrap $OPAM_LOCAL/bin/opam
chmod a+x $OPAM_LOCAL/bin/opam
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/main/upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if [[ ! -f $OPAM12 ]]; then
if [ "$RUNNER_OS" = "macOS" ]; then
os="Darwin"
fi
curl -sL "https://github.com/ocaml/opam/releases/download/1.2.2/opam-1.2.2-x86_64-$os" -o $OPAM12
curl -fsSL "https://github.com/ocaml/opam/releases/download/1.2.2/opam-1.2.2-x86_64-$os" -o $OPAM12
chmod +x $OPAM12
fi
export OPAMROOT=/tmp/opamroot
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/scripts/hygiene.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ if [[ $GITHUB_EVENT_NAME = 'pull_request' ]]; then
fi
URL="$OPAM_BIN_URL_BASE$tag/opam-$tag-$platform"
echo "Downloading $URL"
check=$(curl -Ls "$URL" | sha512sum | cut -d' ' -f1)
check=$(curl -fsSL "$URL" | sha512sum | cut -d' ' -f1)
if [[ $check = $sha ]] ; then
echo " as expected ($sha)"
else
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/ci.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,20 @@ open Lib

let latest_ocaml4 = "4.14.2"
let latest_ocaml5 = "5.4.0" (* Add this number to ocamls below when the next version comes out *)
let trunk = "trunk"
let ocamls = [
(* Fully supported versions *)
"4.08.1"; "4.09.1"; "4.10.2"; "4.11.2"; "4.12.1"; "4.13.1";
"5.0.0"; "5.1.1"; "5.2.1"; "5.3.0";

(* Optionally supported versions *)
trunk;

(* The last elements of the list after 4.14 will be used as default versions *)
latest_ocaml4; latest_ocaml5;
]
let start_latests_ocaml = (4, 14)
let start_latests_ocaml = latest_ocaml4
let oldest_ocamlv = List.hd ocamls

(* Entry point for the workflow. Workflows are specified as continuations where
each job is passed as a continuation to the [workflow], terminated with
Expand Down Expand Up @@ -69,12 +74,9 @@ jobs:

let end_workflow ~oc:_ ~workflow:_ = ()

let ocamls =
List.map (fun v -> Scanf.sscanf v "%u.%u.%u" (fun major minor _ -> ((major, minor), v))) ocamls

let platform_ocaml_matrix ?(dir=List.drop_while) ~fail_fast start_version =
(fail_fast,
[("ocamlv", List.map snd (dir (fun ocaml -> fst ocaml <> start_version) ocamls))],
[("ocamlv", dir (fun ocaml -> not (String.equal ocaml start_version)) ocamls)],
[])

let git_lf_checkouts ?(title="Configure Git") ?cond ?shell () =
Expand Down Expand Up @@ -347,8 +349,8 @@ let main_build_job ~analyse_job ~cygwin_job ?section runner start_version ~oc ~w
++ only_on Windows (unpack_cygwin "${{ matrix.build }}" "${{ matrix.host }}")
++ only_on Windows (run "Cygwin info" ["uname -a"])
++ build_cache OCaml platform "${{ matrix.ocamlv }}" host
++ run "Build" ["bash -exu .github/scripts/main/main.sh " ^ host]
++ not_on Windows (run "Test (basic)" ["bash -exu .github/scripts/main/test.sh"])
++ run ~id:"build" ~continue_on_error:(Printf.sprintf "${{ matrix.ocamlv == '%s' }}" trunk) "Build" ["bash -exu .github/scripts/main/main.sh " ^ host]
++ not_on Windows (run ~cond:(Predicate(false, Compare("steps.build.outcome", "failure"))) "Test (basic)" ["bash -exu .github/scripts/main/test.sh"])
++ only_on Windows (run ~cond:(Predicate(false, EndsWith("matrix.host", "-pc-cygwin"))) "Test \"static\" binaries on Windows" ["ldd ./opam.exe | test \"$(grep -v -F /cygdrive/c/Windows/)\" = ''"])
++ only_on Windows
(uses "Upload opam binaries for Windows"
Expand Down Expand Up @@ -574,7 +576,7 @@ let main oc : unit =
workflow ~oc ~env "Builds, tests & co"
++ analyse_job ~keys ~platforms:[Linux]
@@ fun analyse_job -> cygwin_job ~analyse_job
@@ fun cygwin_job -> main_build_job ~analyse_job ~cygwin_job ~section:"Build" Linux (4, 08)
@@ fun cygwin_job -> main_build_job ~analyse_job ~cygwin_job ~section:"Build" Linux oldest_ocamlv
@@ fun build_linux_job -> main_build_job ~analyse_job ~cygwin_job Windows start_latests_ocaml
@@ fun build_windows_job -> main_build_job ~analyse_job ~cygwin_job MacOS start_latests_ocaml
@@ fun build_macOS_job -> main_test_job ~analyse_job ~build_linux_job ~build_windows_job ~build_macOS_job ~section:"Opam tests" Linux
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/lib.ml
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,11 @@ let emit_condition ~oc ~indent =
let convert cond = fprintf oc "%sif: %s\n" indent (to_yaml cond) in
Option.iter convert

let run name ?id ?cond ?shell ?env run ~oc ~workflow ~job f =
let run name ?id ?continue_on_error ?cond ?shell ?env run ~oc ~workflow ~job f =
fprintf oc " - name: %s\n" name;
Option.iter (emit_env ~indent:6 ~oc) env;
Option.iter (fprintf oc " id: %s\n") id;
Option.iter (fprintf oc " continue-on-error: %s\n") continue_on_error;
emit_condition ~oc ~indent:6 cond;
Option.iter (fprintf oc " shell: %s\n") shell;
begin match run with
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ jobs:
needs: Analyse
strategy:
matrix:
ocamlv: [ 4.08.1, 4.09.1, 4.10.2, 4.11.2, 4.12.1, 4.13.1, 5.0.0, 5.1.1, 5.2.1, 5.3.0, 4.14.2, 5.4.0 ]
ocamlv: [ 4.08.1, 4.09.1, 4.10.2, 4.11.2, 4.12.1, 4.13.1, 5.0.0, 5.1.1, 5.2.1, 5.3.0, trunk, 4.14.2, 5.4.0 ]
fail-fast: true
steps:
- name: Install bubblewrap
Expand Down Expand Up @@ -134,8 +134,11 @@ jobs:
if: steps.ocaml-cache.outputs.cache-hit != 'true'
run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }}
- name: Build
id: build
continue-on-error: ${{ matrix.ocamlv == 'trunk' }}
run: bash -exu .github/scripts/main/main.sh x86_64-pc-linux-gnu
- name: Test (basic)
if: steps.build.outcome != 'failure'
run: bash -exu .github/scripts/main/test.sh

Build-Windows:
Expand Down Expand Up @@ -214,6 +217,8 @@ jobs:
if: steps.ocaml-cache.outputs.cache-hit != 'true'
run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} ${{ matrix.host }}
- name: Build
id: build
continue-on-error: ${{ matrix.ocamlv == 'trunk' }}
run: bash -exu .github/scripts/main/main.sh ${{ matrix.host }}
- name: Test "static" binaries on Windows
if: endsWith(matrix.host, '-pc-cygwin') == false
Expand Down Expand Up @@ -280,8 +285,11 @@ jobs:
if: steps.ocaml-cache.outputs.cache-hit != 'true'
run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }}
- name: Build
id: build
continue-on-error: ${{ matrix.ocamlv == 'trunk' }}
run: bash -exu .github/scripts/main/main.sh x86_64-apple-darwin
- name: Test (basic)
if: steps.build.outcome != 'failure'
run: bash -exu .github/scripts/main/test.sh

####
Expand Down
1 change: 1 addition & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ users)

## Github Actions
* Add OCaml 5.4 to the test matrix [#6732 @kit-ty-kate]
* Ensure `curl`'s exit status to be non-zero on failure [#6684 @kit-ty-kate]

## Doc

Expand Down
Loading