Skip to content

Commit

Permalink
Merge branch 'master' into sanderspies/fix_2682
Browse files Browse the repository at this point in the history
  • Loading branch information
anmonteiro authored Mar 23, 2023
2 parents 81bb9af + 0ce98e0 commit d81a56d
Show file tree
Hide file tree
Showing 233 changed files with 32,042 additions and 527 deletions.
2 changes: 2 additions & 0 deletions .ci/build-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ jobs:
- template: utils/create-docs.yml
- script: "esy test"
displayName: "Test command"
- script: "esy b dune runtest -p reason,rtop"
displayName: "Cram tests command"
- powershell: esy x env
continueOnError: true
condition: and(eq(variables['AGENT.OS'], 'Windows_NT'), and(eq(variables['Build.Reason'], 'PullRequest'), and(succeeded(), ne(variables['Build.SourceBranch'], variables['System.PullRequest.TargetBranch']))))
Expand Down
2 changes: 2 additions & 0 deletions .ci/opam-build-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,7 @@ steps:
displayName: "opam pin add -y rtop ."
- script: eval $(opam env); make test-ci
displayName: "make test-ci"
- script: eval $(opam env); dune runtest
displayName: "dune runtest"
- script: git diff --exit-code
displayName: "Check git is clean"
5 changes: 5 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ common_steps: &common_steps
command: |
eval `opam config env`
make test-ci
- run:
name: 'Cram test'
command: |
eval `opam config env`
dune runtest
- run:
name: 'Check git is clean'
command: git diff --exit-code
Expand Down
120 changes: 120 additions & 0 deletions .github/workflows/esy-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: esy CI

on:
pull_request:
push:
branches:
- master

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

defaults:
run:
shell: bash

jobs:
build:
name: Build
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest

ocaml-compiler:
# Please keep the list in sync with the minimal version of OCaml in
# esy.json, reason.esy/reason.opam and rtop.esy/rtop.opam.
- 4.06.x # We support 4.06 because is the one that is used in BuckleScript / ReScript v9
- 4.10.x
- 4.12.x
- 4.14.x

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 16

- name: Install esy
run: npm install -g [email protected]

- name: Restore global cache (~/.esy/source)
id: global-cache
uses: actions/cache/restore@v3
with:
path: ~/.esy/source
key: esy-source-${{ matrix.os }}-${{ matrix.ocaml-compiler }}-${{ hashFiles('esy.lock.json') }}

- name: Print esy cache
id: print_esy_cache
run: echo "ESY_CACHE=$(node .github/workflows/print-esy-cache.js)" >> $GITHUB_OUTPUT;

- name: Load dependencies cache
id: deps-cache
uses: actions/cache/restore@v3
with:
path: |
${{ steps.print_esy_cache.outputs.ESY_CACHE }}
_export
key: esy-build-${{ matrix.os }}-${{ matrix.ocaml-compiler }}-${{ hashFiles('esy.lock.json') }}
restore-keys: esy-build-${{ matrix.os }}-

- name: Instal OCaml ${{ matrix.ocaml-compiler }}
run: esy add ocaml@${{ matrix.ocaml-compiler }}

- name: Install dependencies
run: esy install

- name: Import dependencies
if: steps.deps-cache.outputs.cache-hit == 'true'
# Don't crash the run if esy cache import fails - mostly happens on Windows
continue-on-error: true
run: |
esy import-dependencies _export
rm -rf _export
- name: Build dependencies
run: esy build-dependencies

- name: Build
run: esy build

- name: Test when not Windows
if: runner.os != 'Windows'
run: esy dune runtest

- name: Test when Windows
if: runner.os == 'Windows'
run: esy b dune runtest -p "reason,rtop"

- name: Export dependencies
if: steps.deps-cache.outputs.cache-hit != 'true'
run: esy export-dependencies

- name: Save global cache
uses: actions/cache/save@v3
if: steps.global-cache.outputs.cache-hit != 'true'
with:
path: ~/.esy/source
key: esy-source-${{ matrix.os }}-${{ matrix.ocaml-compiler }}-${{ hashFiles('esy.lock.json') }}

- name: Save dependencies cache
if: steps.deps-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v3
with:
path: |
${{ steps.print_esy_cache.outputs.ESY_CACHE }}
_export
key: esy-build-${{ matrix.os }}-${{ matrix.ocaml-compiler }}-${{ hashFiles('esy.lock.json') }}

# Cleanup build cache in case dependencies have changed
- name: Cleanup
if: steps.deps-cache.outputs.cache-hit != 'true'
run: esy cleanup .
82 changes: 82 additions & 0 deletions .github/workflows/opam-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: opam CI

on:
pull_request:
push:
branches:
- master

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest

ocaml-compiler:
# Please keep the list in sync with the minimal version of OCaml in
# esy.json, reason.esy/reason.opam and rtop.esy/rtop.opam.
- 4.06.x # We support 4.06 because is the one that is used in BuckleScript / ReScript v9
- 4.10.x
- 4.12.x
- 4.14.x

runs-on: ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
opam-pin: false

- name: Load opam cache when not Windows
if: runner.os != 'Windows'
id: opam-cache
uses: actions/cache/restore@v3
with:
path: ~/.opam
key: opam-${{ matrix.os }}-${{ matrix.ocaml-compiler }}-${{ hashFiles('**.opam') }}

- name: Load opam cache when Windows
if: runner.os == 'Windows'
id: opam-cache-windows
uses: actions/cache/restore@v3
with:
path: _opam
key: opam-${{ matrix.os }}-${{ matrix.ocaml-compiler }}-${{ hashFiles('**.opam') }}

- name: Install dependencies
run: opam install . --deps-only

- name: Build reason and rtop
run: opam exec -- dune build -p reason,rtop

- name: Test
run: opam exec -- dune runtest

- name: Save cache when not Windows
uses: actions/cache/save@v3
if: steps.opam-cache.outputs.cache-hit != 'true' && runner.os != 'Windows'
with:
path: ~/.opam
key: opam-${{ matrix.os }}-${{ matrix.ocaml-compiler }}-${{ hashFiles('**.opam') }}

- name: Save cache when Windows
uses: actions/cache/save@v3
if: steps.opam-cache-windows.outputs.cache-hit != 'true' && runner.os == 'Windows'
with:
path: _opam
key: opam-${{ matrix.os }}-${{ matrix.ocaml-compiler }}-${{ hashFiles('**.opam') }}

17 changes: 17 additions & 0 deletions .github/workflows/print-esy-cache.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const fs = require("fs");
const os = require("os");
const path = require("path");

const ESY_FOLDER = process.env.ESY__PREFIX
? process.env.ESY__PREFIX
: path.join(os.homedir(), ".esy");

const someEsy3 = fs
.readdirSync(ESY_FOLDER)
.filter((name) => name.length > 0 && name[0] === "3");

const esy3 = someEsy3
.sort()
.pop();

console.log(path.join(ESY_FOLDER, esy3, "i"));
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,15 @@ node_modules
/bspacks/build/
/bspacks/ocaml-migrate-parsetree/
/bspacks/closure-compiler/

# gitignored, but not npmignored. Published by `npm run prepublish`
refmt.js
refmt.map
.merlin

# Esy
_esy
_esybuild
_esyinstall
.merlin
_release
_export/
3 changes: 2 additions & 1 deletion HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
## 3.9 (unreleased)

- Fix missing patterns around contraint pattern (a pattern with a type annotation).
- Fix missing patterns around constraint pattern (a pattern with a type annotation).
- Reduce the amount of parentheses around functor usage (@SanderSpies, [#2683](https://github.com/reasonml/reason/pull/2683)).
- Fix top level extension printing (@davesnx, [#2693](https://github.com/reasonml/reason/pull/2693)).

## 3.8.2

Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ test-once-installed: clean-tests
./miscTests/rtopIntegrationTest.sh
./miscTests/backportSyntaxTests.sh
cd formatTest; ./test.sh
dune runtest

.PHONY: coverage
coverage:
Expand Down
2 changes: 1 addition & 1 deletion dune-project
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(lang dune 2.7)
(lang dune 2.8)
(name reason)

(using menhir 2.0)
Expand Down
6 changes: 3 additions & 3 deletions esy.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
"license": "MIT",
"version": "3.8.1",
"dependencies": {
"@opam/dune": "2.9.3",
"@opam/dune": "3.6.2",
"@opam/fix": "*",
"@opam/menhir": " >= 20180523.0.0",
"@opam/merlin-extend": " >= 0.6",
"@opam/ocamlfind": "*",
"@opam/ocamlfind": "1.9.5",
"@opam/ppx_derivers": "< 2.0.0",
"@opam/result": "*",
"@opam/utop": " >= 1.17.0",
Expand Down Expand Up @@ -37,7 +37,7 @@
"SYSTEM_PULLREQUEST_MERGEDAT": { "scope": "global", "val": "d" }
},
"release": {
"bin": { "rtop": "rtop", "refmt": "refmt" },
"bin": ["rtop", "refmt"],
"includePackages": [
"root", "@opam/base-bytes", "@opam/base-threads", "@opam/base-unix",
"@opam/camomile", "@opam/lambda-term", "@opam/lwt", "@opam/lwt_log",
Expand Down
Loading

0 comments on commit d81a56d

Please sign in to comment.