Skip to content

Commit 6d640de

Browse files
cknittclaude
andcommitted
Check for dead code in CI
The build-compiler job that builds the playground now runs make dead-code after the playground build, so new dead code fails CI. It installs reanalyze 2.27.0, the first release that analyzes the native and the browser build trees together, from its tag until the opam-repository package is merged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kbf3gLDo8mBJKpNE25WAwT Signed-off-by: Christoph Knittel <ck@cca.io>
1 parent e3da186 commit 6d640de

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,15 @@ jobs:
275275
if: matrix.build_playground
276276
run: opam exec -- make playground
277277

278+
# Runs after the playground build, whose browser-profile tree it
279+
# analyzes together with the native one.
280+
- name: Check for dead code
281+
if: matrix.build_playground
282+
run: |
283+
opam pin add --yes --no-action reanalyze git+https://github.com/rescript-lang/reanalyze.git#v2.27.0
284+
opam install --yes reanalyze
285+
opam exec -- make dead-code
286+
278287
- name: Test playground compiler
279288
if: matrix.build_playground
280289
run: yarn workspace playground test

‎changes/dead-code-ci.internal.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Check in CI that reanalyze reports no dead code in the OCaml sources.

‎scripts/dead_code.sh‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
# anything.
55
#
66
# Usage: REANALYZE=/path/to/reanalyze.exe ./scripts/dead_code.sh
7-
# (defaults to reanalyze.exe on PATH; needs a reanalyze that analyzes several
8-
# build trees together, rescript-lang/reanalyze#224)
7+
# (defaults to reanalyze.exe on PATH; needs reanalyze 2.27.0 or later, which
8+
# analyzes several build trees together: opam install reanalyze)
99

1010
set -euo pipefail
1111
cd "$(dirname "$0")/.."

0 commit comments

Comments
 (0)