mirror of
https://github.com/c-cube/linol.git
synced 2025-12-06 03:05:31 -05:00
103 lines
2.7 KiB
YAML
103 lines
2.7 KiB
YAML
name: Build and Test
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- master
|
|
schedule:
|
|
# Prime the caches every Monday
|
|
- cron: 0 1 * * MON
|
|
|
|
jobs:
|
|
build-and-test:
|
|
name: Build and Test
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os:
|
|
- ubuntu-latest
|
|
- macos-latest
|
|
- windows-latest
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
- name: Set git to use LF
|
|
run: |
|
|
git config --global core.autocrlf false
|
|
git config --global core.eol lf
|
|
|
|
- name: Checkout tree
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: true
|
|
|
|
- name: Set-up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: lts/*
|
|
|
|
- name: Install npm packages
|
|
run: yarn install --frozen-lockfile
|
|
|
|
- name: Set-up OCaml
|
|
uses: ocaml/setup-ocaml@v3
|
|
with:
|
|
ocaml-compiler: "ocaml-base-compiler.5.3.0"
|
|
|
|
# Remove this pin once a compatible version of Merlin has been released
|
|
- name: Pin dev Merlin
|
|
run: opam --cli=2.1 pin --with-version=5.4-503 https://github.com/ocaml/merlin.git#main
|
|
|
|
- name: Build and install dependencies
|
|
run: opam install .
|
|
|
|
# the makefile explains why we don't use --with-test
|
|
# ppx expect is not yet compatible with 5.1 and test output vary from one
|
|
# compiler to another. We only test on 4.14.
|
|
- name: Install test dependencies
|
|
run: opam exec -- make install-test-deps
|
|
|
|
- name: Run build @all
|
|
run: opam exec -- make all
|
|
|
|
- name: Run the unit tests
|
|
run: opam exec -- make test-ocaml
|
|
|
|
- name: Run the template integration tests
|
|
run: opam exec -- make test-e2e
|
|
|
|
coverage:
|
|
name: Coverage
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout tree
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: true
|
|
|
|
- name: Set-up OCaml
|
|
uses: ocaml/setup-ocaml@v3
|
|
with:
|
|
ocaml-compiler: "ocaml-base-compiler.5.3.0"
|
|
|
|
- name: Set git user
|
|
run: |
|
|
git config --global user.name github-actions[bot]
|
|
git config --global user.email github-actions[bot]@users.noreply.github.com
|
|
|
|
# Remove this pin once a compatible version of Merlin has been released
|
|
- name: Pin dev Merlin
|
|
run: opam --cli=2.1 pin --with-version=5.4-503 https://github.com/ocaml/merlin.git#main
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
opam install . --deps-only
|
|
opam exec -- make coverage-deps install-test-deps
|
|
|
|
- run: opam exec -- make test-coverage
|
|
env:
|
|
COVERALLS_REPO_TOKEN: ${{ github.token }}
|
|
PULL_REQUEST_NUMBER: ${{ github.event.number }}
|