Skip to content
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
82 changes: 35 additions & 47 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ concurrency:

env:
OCAMLRUNPARAM: b
RUST_BACKTRACE: "1"
RUSTFLAGS: "-Dwarnings"

jobs:
build-compiler:
Expand Down Expand Up @@ -52,7 +54,7 @@ jobs:
upload_binaries: true
node-target: darwin-arm64
rust-target: aarch64-apple-darwin
- os: windows-2022
- os: windows-2025
ocaml_compiler: 5.3.0
upload_binaries: true
node-target: win32-x64
Expand All @@ -68,12 +70,8 @@ jobs:
runs-on: ${{matrix.os}}

env:
# setup-ocaml opam version cannot be configured
# we do track its version manually
OPAM_VERSION: 2.3.0
DUNE_PROFILE: release
RUST_BACKTRACE: "1"
RUSTFLAGS: "-Dwarnings"
# When changing the setup-ocaml version, also adjust it in the setup step further below.
SETUP_OCAML_VERSION: 3.4.6 # OPAM <2.6.0

steps:
- name: "Windows: Set git config"
Expand Down Expand Up @@ -102,9 +100,10 @@ jobs:
if: runner.os == 'Linux'
uses: awalsh128/cache-apt-pkgs-action@v1.4.3
with:
# See https://github.com/ocaml/setup-ocaml/blob/b2105f9/packages/setup-ocaml/src/unix.ts#L9
packages: bubblewrap darcs g++-multilib gcc-multilib mercurial musl-tools rsync
version: v3
# https://github.com/ocaml/setup-ocaml/blob/2f57267f071bc8547dfcb9433ff21d44fffef190/packages/setup-ocaml/src/unix.ts#L48
# plus OPAM wants cmake
packages: bubblewrap darcs g++-multilib gcc-multilib mercurial musl-tools rsync cmake
version: v4

- name: Restore rewatch build cache
id: rewatch-build-cache
Expand Down Expand Up @@ -147,7 +146,7 @@ jobs:
# matrix.ocaml_compiler may contain commas
- name: Get OPAM cache key
shell: bash
run: echo "opam_cache_key=opam-env-v8-${{ matrix.os }}-${{ matrix.ocaml_compiler }}-${{ hashFiles('*.opam') }}" | sed 's/,/-/g' >> $GITHUB_ENV
run: echo "opam_cache_key=opam-env-v8-${{ matrix.os }}-${{ env.SETUP_OCAML_VERSION }}-${{ matrix.ocaml_compiler }}-${{ hashFiles('*.opam') }}" | sed 's/,/-/g' >> $GITHUB_ENV

- name: Restore OPAM environment
id: cache-opam-env
Expand All @@ -158,12 +157,12 @@ jobs:
~/.opam
_opam
.opam-path
D:\cygwin
D:\.opam
C:\cygwin
C:\.opam
key: ${{ env.opam_cache_key }}

- name: Use OCaml ${{matrix.ocaml_compiler}}
uses: ocaml/setup-ocaml@v3.3.2
uses: ocaml/setup-ocaml@v3.4.6
if: steps.cache-opam-env.outputs.cache-hit != 'true'
with:
ocaml-compiler: ${{matrix.ocaml_compiler}}
Expand Down Expand Up @@ -194,25 +193,29 @@ jobs:
~/.opam
_opam
.opam-path
D:\cygwin
D:\.opam
C:\cygwin
C:\.opam
key: ${{ env.opam_cache_key }}

- name: Use cached OPAM environment
if: steps.cache-opam-env.outputs.cache-hit == 'true'
run: |
# https://github.com/ocaml/setup-ocaml/blob/b2105f9/packages/setup-ocaml/src/installer.ts#L33
echo "OPAMVERBOSE=$RUNNER_DEBUG" >> "$GITHUB_ENV"
echo "OPAMCOLOR=always" >> "$GITHUB_ENV"
echo "OPAMCONFIRMLEVEL=unsafe-yes" >> "$GITHUB_ENV"
echo "OPAMERRLOGLEN=0" >> "$GITHUB_ENV"
echo "OPAMPRECISETRACKING=1" >> "$GITHUB_ENV"
echo "OPAMYES=1" >> "$GITHUB_ENV"
# https://github.com/ocaml/setup-ocaml/blob/v3.4.6/packages/setup-ocaml/src/installer.ts
echo "OPAMCOLOR=always" >> "$GITHUB_ENV"
echo "OPAMCONFIRMLEVEL=unsafe-yes" >> "$GITHUB_ENV"
echo "OPAMDOWNLOADJOBS=4" >> "$GITHUB_ENV"
echo "OPAMERRLOGLEN=0" >> "$GITHUB_ENV"
echo "OPAMEXTERNALSOLVER=builtin-0install" >> "$GITHUB_ENV"
echo "OPAMPRECISETRACKING=1" >> "$GITHUB_ENV"
echo "OPAMRETRIES=10" >> "$GITHUB_ENV"
echo "OPAMSOLVERTIMEOUT=600" >> "$GITHUB_ENV"
echo "OPAMYES=1" >> "$GITHUB_ENV"
echo "CLICOLOR_FORCE=1" >> "$GITHUB_ENV"

if [[ "$RUNNER_OS" != "Windows" ]]; then
echo "OPAMROOT=$HOME/.opam" >> "$GITHUB_ENV"
else
echo "OPAMROOT=D:\\.opam" >> "$GITHUB_ENV"
echo "OPAMROOT=C:\\.opam" >> "$GITHUB_ENV"
fi

OPAM_PATH="$(cat .opam-path)"
Expand All @@ -224,27 +227,18 @@ jobs:
fsutil behavior set symlinkEvaluation R2L:1 R2R:1
fsutil behavior query SymlinkEvaluation

CYGWIN="winsymlinks:native"
CYGWIN_ROOT="D:\\cygwin"
CYGWIN_ROOT_BIN="D:\\cygwin\\bin"
CYGWIN_ROOT_WRAPPERBIN="D:\\cygwin\\wrapperbin"

echo "HOME=$USERPROFILE" >> "$GITHUB_ENV"
echo "MSYS=winsymlinks:native" >> "$GITHUB_ENV"
echo "CYGWIN=$CYGWIN" >> "$GITHUB_ENV"
echo "CYGWIN_ROOT=$CYGWIN_ROOT" >> "$GITHUB_ENV"
echo "CYGWIN_ROOT_BIN=$CYGWIN_ROOT_BIN" >> "$GITHUB_ENV"
echo "CYGWIN_ROOT_WRAPPERBIN=$CYGWIN_ROOT_WRAPPERBIN" >> "$GITHUB_ENV"

echo "$CYGWIN_ROOT_WRAPPERBIN" >> "$GITHUB_PATH"
echo "CYGWIN=winsymlinks:native" >> "$GITHUB_ENV"
echo "BASH_ENV=C:\\cygwin\\bash_env" >> "$GITHUB_ENV"
fi
shell: bash

- name: Compiler build state key
id: compiler-build-state-key
shell: bash
run: |
echo "value=compiler-build-state-v1-${{ matrix.os }}-${{ matrix.ocaml_compiler }}-${{ hashFiles('*.opam') }}" \
echo "value=compiler-build-state-v1-${{ matrix.os }}-${{ env.SETUP_OCAML_VERSION }}-${{ matrix.ocaml_compiler }}-${{ hashFiles('*.opam') }}" \
| sed 's/,/-/g' >> "$GITHUB_OUTPUT"

- name: Restore compiler build state
Expand All @@ -253,7 +247,7 @@ jobs:
uses: actions/cache/restore@v4
with:
path: |
D:\.cache\dune
C:\.cache\dune
~/.cache/dune
_build
key: ${{ steps.compiler-build-state-key.outputs.value }}
Expand Down Expand Up @@ -283,7 +277,7 @@ jobs:
uses: actions/cache/save@v4
with:
path: |
D:\.cache\dune
C:\.cache\dune
~/.cache/dune
_build
key: ${{ steps.compiler-build-state-key.outputs.value }}
Expand Down Expand Up @@ -548,10 +542,8 @@ jobs:
- os: macos-15
- os: ubuntu-24.04
- os: ubuntu-24.04-arm
- os: windows-2022
- os: windows-2025
runs-on: ${{ matrix.os }}
env:
RUST_BACKTRACE: "1"
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -599,10 +591,8 @@ jobs:
- os: macos-15
- os: ubuntu-24.04
- os: ubuntu-24.04-arm
- os: windows-2022
- os: windows-2025
runs-on: ${{ matrix.os }}
env:
RUST_BACKTRACE: "1"
steps:
- name: Install pnpm
uses: pnpm/action-setup@v4
Expand Down Expand Up @@ -654,10 +644,8 @@ jobs:
- os: macos-15
- os: ubuntu-24.04
- os: ubuntu-24.04-arm
- os: windows-2022
- os: windows-2025
runs-on: ${{ matrix.os }}
env:
RUST_BACKTRACE: "1"
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#### :house: Internal

- Rename Core to Stdlib in tests/tests. https://github.com/rescript-lang/rescript/pull/8005
- CI: Build on `windows-2025` runners. https://github.com/rescript-lang/rescript/pull/8006

# 12.0.0-rc.3

Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ Happy hacking!

> Most of our contributors are working on Apple machines, so all our instructions are currently macOS / Linux centric. Contributions for Windows development welcome!

- [Node.js](https://nodejs.org/) v22.x
- [Node.js](https://nodejs.org/) v22.x or newer
- [Yarn CLI](https://yarnpkg.com/getting-started/install) (can be installed with `corepack`, Homebrew, etc)
- C compiler toolchain (usually installed with `xcode` on Mac)
- Python <= 3.11 (required to build ninja)
- Rust toolchain (required to build rewatch; follow the instructions at https://www.rust-lang.org/tools/install)
- `opam` (OCaml Package Manager) v2.2.0
- `opam` (OCaml Package Manager) v2.2.0 or newer
- VSCode (+ [OCaml Platform Extension](https://marketplace.visualstudio.com/items?itemName=ocamllabs.ocaml-platform))

## Cloning the Git Repo
Expand Down
Loading