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
39 changes: 1 addition & 38 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,9 @@ jobs:
- os: ubuntu-26.04-arm # ARM
ocaml_compiler: ocaml-variants.5.5.2+options,ocaml-option-static
upload_binaries: true
# Build the playground compiler and run the benchmarks on the fastest runner
# Build the playground compiler on the fastest runner
build_playground: true
generate_api_docs: true
benchmarks: true
test_commit_records: true
node-target: linux-arm64
rust-target: aarch64-unknown-linux-musl
Expand Down Expand Up @@ -298,42 +297,6 @@ jobs:
run: ./rewatch/tests/suite.sh packages/@rescript/${{ matrix.node-target }}/bin/rescript-rust.exe
shell: bash

- name: Run syntax benchmarks
if: matrix.benchmarks
run: |
set -o pipefail
./_build/install/default/bin/syntax_benchmarks | tee tests/benchmark-output.json

# Benchmarking is disabled for now because of inconsistent run times on different runners
#
# - name: Restore previous benchmark data
# if: matrix.benchmarks
# uses: actions/cache/restore@v6
# with:
# path: ./tests/benchmark-cache
# key: syntax-benchmark-v1

# - name: Create new benchmark data and comment on alert
# # Do not run for PRs created from other repos as those won't be able to write to the pull request
# if: ${{ matrix.benchmarks && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.event.repository.full_name) }}
# uses: benchmark-action/github-action-benchmark@v1
# with:
# name: Syntax Benchmarks
# tool: customSmallerIsBetter
# output-file-path: tests/benchmark-output.json
# external-data-json-path: ./tests/benchmark-cache/benchmark-data.json
# github-token: ${{ secrets.GITHUB_TOKEN }}
# alert-threshold: "105%"
# comment-always: false
# comment-on-alert: true

# - name: Save benchmark data as new baseline
# if: matrix.benchmarks && github.ref == 'refs/heads/master'
# uses: actions/cache/save@v6
# with:
# path: ./tests/benchmark-cache
# key: syntax-benchmark-v1

- name: Build playground compiler
if: matrix.build_playground
run: opam exec -- make playground
Expand Down
1 change: 1 addition & 0 deletions changes/ci-stale-steps.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Remove the unused syntax benchmark CI step and the macOS 13 docstring test workaround.
80 changes: 37 additions & 43 deletions scripts/test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// @ts-check

import * as fs from "node:fs";
import * as os from "node:os";
import * as path from "node:path";
import {
buildTestDir,
Expand Down Expand Up @@ -184,54 +183,49 @@ if (buildTest) {
}

if (runtimeDocstrings) {
if (process.platform === "darwin" && os.release().startsWith("22")) {
// Workaround for intermittent hangs in CI
console.log("Skipping docstrings tests on macOS 13");
} else {
console.log("Running runtime docstrings tests");
console.log("Running runtime docstrings tests");

const generated_mocha_test_res = path.join(
docstringTestDir,
"generated_mocha_test.res",
);
const generated_mocha_test_res = path.join(
docstringTestDir,
"generated_mocha_test.res",
);

// This generated source file is checked during the initial build below, so
// a stale copy from an earlier run can fail before we regenerate it.
await fs.promises.rm(generated_mocha_test_res, { force: true });
// This generated source file is checked during the initial build below, so
// a stale copy from an earlier run can fail before we regenerate it.
await fs.promises.rm(generated_mocha_test_res, { force: true });

await execClean([], {
cwd: docstringTestDir,
stdio: "inherit",
});
await execClean([], {
cwd: docstringTestDir,
stdio: "inherit",
});

await execBuild([], {
cwd: docstringTestDir,
stdio: "inherit",
});
await execBuild([], {
cwd: docstringTestDir,
stdio: "inherit",
});

// Generate rescript file with all tests `generated_mocha_test.res`
await node(path.join(docstringTestDir, "DocTest.res.js"), [], {
cwd: projectDir,
stdio: "inherit",
});
// Generate rescript file with all tests `generated_mocha_test.res`
await node(path.join(docstringTestDir, "DocTest.res.js"), [], {
cwd: projectDir,
stdio: "inherit",
});

// Build again to check if generated_mocha_test.res has syntax or type erros
await execBuild([], {
cwd: docstringTestDir,
stdio: "inherit",
});
// Build again to check if generated_mocha_test.res has syntax or type erros
await execBuild([], {
cwd: docstringTestDir,
stdio: "inherit",
});

// Format generated_mocha_test.res
console.log("Formatting generated_mocha_test.res");
await rescript("format", [generated_mocha_test_res], {
cwd: projectDir,
stdio: "inherit",
});
// Format generated_mocha_test.res
console.log("Formatting generated_mocha_test.res");
await rescript("format", [generated_mocha_test_res], {
cwd: projectDir,
stdio: "inherit",
});

console.log("Run mocha test");
await mocha([path.join(docstringTestDir, "generated_mocha_test.res.js")], {
cwd: projectDir,
stdio: "inherit",
});
}
console.log("Run mocha test");
await mocha([path.join(docstringTestDir, "generated_mocha_test.res.js")], {
cwd: projectDir,
stdio: "inherit",
});
}
Loading