Skip to content

Generate boostrap.js file with client component refs #1190

Generate boostrap.js file with client component refs

Generate boostrap.js file with client component refs #1190

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
OPAM_VERSION: 2.3.0
DUNE_PROFILE: release
OCAMLRUNPARAM: b
permissions:
contents: write
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
defaults:
run:
shell: bash -xeuo pipefail {0}
jobs:
build:
name: Build and test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
# - windows-latest
ocaml-compiler:
- 5.1.1
steps:
- uses: actions/checkout@v4
- name: Fix MacOS (by installing pkgconf) # https://github.com/ocaml/setup-ocaml/issues/897
if: matrix.os == 'macos-latest'
run: |
if ! brew list pkgconf &> /dev/null; then
brew update
brew upgrade
brew install pkgconf
brew link --overwrite pkgconf
fi
- name: Load opam cache
id: opam-cache
uses: actions/cache/restore@v4
with:
path: |
${{ runner.tool_cache }}/opam
~/.opam
_opam
.opam-path
key: opam-${{ matrix.os }}-${{ matrix.ocaml-compiler }}-${{ hashFiles('**.opam') }}
- name: Load npm cache
id: npm-cache
uses: actions/cache/restore@v4
with:
path: |
node_modules
demo/node_modules
key: npm-${{ matrix.os }}-${{ hashFiles('package.json') }}
- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/[email protected]
if: steps.opam-cache.outputs.cache-hit != 'true'
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
dune-cache: false
opam-disable-sandboxing: true
- name: Get OPAM executable path
if: steps.opam-cache.outputs.cache-hit != 'true'
uses: actions/github-script@v7
with:
script: |
const opam_path = await io.which('opam', true);
console.log('opam executable found: %s', opam_path);
const Fs = require('fs/promises');
await Fs.writeFile('.opam-path', opam_path, 'utf-8');
console.log('stored path to .opam-path');
- name: Use cached OPAM environment
# if: steps.opam-cache.outputs.cache-hit == 'true'
shell: bash
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"
echo "OPAMROOT=$HOME/.opam" >> "$GITHUB_ENV"
OPAM_PATH="$(cat .opam-path)"
chmod +x "$OPAM_PATH"
dirname "$OPAM_PATH" >> "$GITHUB_PATH"
- name: Use Node.js
uses: actions/setup-node@v4
with:
cache: 'npm'
- name: Install opam deps
run: make install
- name: Install npm deps
# if: steps.npm-cache.outputs.cache-hit != 'true'
run: make install-npm
- name: Pin dependencies
if: steps.opam-cache.outputs.cache-hit != 'true'
run: make pin
- name: Build
run: make build
- name: Check formatting
run: make format-check
- name: Run tests
run: make test
- name: Generate docs
if: github.ref == 'refs/heads/main'
run: make docs
- name: Publish docs
uses: crazy-max/ghaction-github-pages@v1
if: github.ref == 'refs/heads/main'
with:
target_branch: gh-pages
build_dir: _build/default/_doc_new/html/docs/
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Run benchmarks
run: make bench
- name: Save opam cache
uses: actions/cache/save@v4
if: steps.opam-cache.outputs.cache-hit != 'true'
with:
path: |
${{ runner.tool_cache }}/opam
~/.opam
_opam
.opam-path
key: opam-${{ matrix.os }}-${{ matrix.ocaml-compiler }}-${{ hashFiles('**.opam') }}
- name: Save npm cache
uses: actions/cache/save@v4
with:
path: node_modules
key: npm-${{ matrix.os }}-${{ hashFiles('package.json') }}