Skip to content

fix(demo): disable demo executable on Windows (tiny_httpd is Unix-only) #416

fix(demo): disable demo executable on Windows (tiny_httpd is Unix-only)

fix(demo): disable demo executable on Windows (tiny_httpd is Unix-only) #416

Workflow file for this run

name: CI
on:
push:
branches:
- main
tags:
- '*'
pull_request:
permissions:
contents: write
pull-requests: write
jobs:
build:
name: Build and test
runs-on: ${{ matrix.os }}
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
DUNE_RELEASE_GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
TERM: dumb
OPAMYES: 1
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
ocaml-compiler:
- 4.14.2
- 5.3.0
- 5.4.0
include:
- os: windows-latest
ocaml-compiler: 5.4.0
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: ${{ startsWith(github.ref, 'refs/tags/') && '0' || '1' }}
- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
- name: Pin dependencies
run: make pin
- name: Install (with dev-setup)
if: runner.os != 'Windows'
run: make install
- name: Install (without dev-setup)
if: runner.os == 'Windows'
run: opam install . --deps-only --with-test --with-doc -y
- name: Build
run: make build
- name: Check formatting
if: runner.os != 'Windows'
run: make format-check
- name: Run tests
run: make test
- name: Run benchmarks
if: runner.os != 'Windows'
run: make bench
- name: Run benchmarks (JSON output for tracking)
if: matrix.os == 'ubuntu-latest' && matrix.ocaml-compiler == '5.4.0'
run: make bench-ci
- name: Store benchmark result
if: matrix.os == 'ubuntu-latest' && matrix.ocaml-compiler == '5.4.0'
uses: benchmark-action/github-action-benchmark@v1
with:
name: html_of_jsx Benchmarks
tool: 'customBiggerIsBetter'
output-file-path: bench_results.json
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: ${{ github.ref == 'refs/heads/main' }}
gh-pages-branch: gh-pages
benchmark-data-dir-path: dev/bench
fail-on-alert: true
summary-always: true
- name: Build docs site
if: github.ref == 'refs/heads/main' && matrix.os == 'ubuntu-latest' && matrix.ocaml-compiler == '5.4.0'
run: make docs-site
- name: Publish docs site
if: github.ref == 'refs/heads/main' && matrix.os == 'ubuntu-latest' && matrix.ocaml-compiler == '5.4.0'
uses: crazy-max/ghaction-github-pages@v5
with:
target_branch: gh-pages
build_dir: docs/_site/
keep_history: true
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Upload build artifacts
if: startsWith(github.ref, 'refs/tags/') && matrix.os == 'ubuntu-latest' && matrix.ocaml-compiler == '5.3.0'
uses: actions/upload-artifact@v7
with:
name: release-artifacts
path: |
_build/
_opam/
retention-days: 1