Skip to content

Reuse node, ocaml, and rewatch setup between ci.yml and coverage.yml#8506

Open
cknitt wants to merge 4 commits into
masterfrom
ci-reuse
Open

Reuse node, ocaml, and rewatch setup between ci.yml and coverage.yml#8506
cknitt wants to merge 4 commits into
masterfrom
ci-reuse

Conversation

@cknitt

@cknitt cknitt commented Jul 11, 2026

Copy link
Copy Markdown
Member

Summary

Extract repeated CI environment setup into local composite actions shared by the main CI, coverage, and release workflows.

What changed

  • Add a shared Node setup action that:
    • uses the repository’s configured Node version
    • enables Yarn caching
    • configures the public npm registry
    • installs dependencies with yarn install --immutable
  • Add a shared OCaml setup action that:
    • restores or creates the OPAM environment
    • supports different compiler switches and dependency flags
    • reconstructs cached OPAM environments on Linux, macOS, and Windows
    • only creates shared caches during push workflows
  • Add a shared Rewatch build action that:
    • restores or builds the requested Rust target
    • optionally runs Clippy and unit tests
    • copies the resulting executable into the expected package locations
  • Add a shared Linux system-dependency action.
  • Reuse these actions from ci.yml and coverage.yml.
  • Reuse the Node action from the playground and publishing jobs.

Why

The CI and coverage workflows independently implemented nearly identical Node, Rust, Rewatch, OCaml, and OPAM cache setup. Keeping those copies synchronized was error-prone, particularly around:

  • cache keys and paths
  • Rust toolchain versions and targets
  • OPAM environment restoration
  • Windows-specific OPAM configuration
  • dependency installation flags

Centralizing this setup gives those workflows one implementation while retaining their intentional differences, such as coverage’s additional development dependencies and native Rewatch build.

Behavior

This is intended as a structural refactoring. Existing build, test, coverage, artifact, and publishing behavior remains unchanged.

@pkg-pr-new

pkg-pr-new Bot commented Jul 11, 2026

Copy link
Copy Markdown

Open in StackBlitz

rescript

npm i https://pkg.pr.new/rescript@8506

@rescript/darwin-arm64

npm i https://pkg.pr.new/@rescript/darwin-arm64@8506

@rescript/darwin-x64

npm i https://pkg.pr.new/@rescript/darwin-x64@8506

@rescript/linux-arm64

npm i https://pkg.pr.new/@rescript/linux-arm64@8506

@rescript/linux-x64

npm i https://pkg.pr.new/@rescript/linux-x64@8506

@rescript/runtime

npm i https://pkg.pr.new/@rescript/runtime@8506

@rescript/win32-x64

npm i https://pkg.pr.new/@rescript/win32-x64@8506

commit: 94707d7

@github-actions

Copy link
Copy Markdown

@cknitt

cknitt commented Jul 12, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 94707d726a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@cknitt cknitt marked this pull request as ready for review July 12, 2026 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant