-
Notifications
You must be signed in to change notification settings - Fork 3
83 lines (70 loc) · 2.71 KB
/
Copy pathci.yml
File metadata and controls
83 lines (70 loc) · 2.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: ci
on:
push:
branches:
- main
pull_request:
branches:
- "**" # This will match pull requests targeting any branch
permissions:
contents: read
jobs:
build:
name: CI
runs-on: ubuntu-latest
env:
OCAML_VERSION: "5.5"
DUNE_VERSION: "3.24.2"
DUNE_DIGEST: "sha256:3a9cac891f0b6086bfbf58d16c6c17ddfd1d493e031b6b43901f585a7f6899c7"
defaults:
run:
shell: bash
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup mdexp
uses: mbarbin/mdexp-actions/setup-mdexp@42da13e622de9559da363ef5906ffde63a982efd # v1.0.0-alpha.1
with:
mdexp-version: "0.0.20260814"
mdexp-digest: "sha256:47e5646b2cd5bc802bfb776b1a110708195209ffbb6d9d2c274e368467842c15"
- name: Environment setup
run: |
echo "DUNE_WORKSPACE=$PWD/dune-workspace.${{ env.OCAML_VERSION }}" >> "$GITHUB_ENV"
- name: Setup Dune
uses: mbarbin/setup-dune@03ede0220d3fe665f250727d8e21b7c0f9517f3b # v2.0.0+patch-7
env:
GH_TOKEN: ${{ github.token }}
with:
version: "${{ env.DUNE_VERSION }}"
dune-digest: "${{ env.DUNE_DIGEST }}"
workspace: "${{ env.DUNE_WORKSPACE }}"
cache-prefix: "main-ci-${{ env.OCAML_VERSION }}"
cache-readonly: ${{ github.ref != 'refs/heads/main' }}
steps: install-dune enable-pkg lazy-update-depexts install-gpatch install-depexts
# Setting implicit_transitive_deps based on the compiler version.
- name: Edit dune-project
run: sed -i 's/(implicit_transitive_deps [^)]*)/(implicit_transitive_deps false)/' dune-project
- name: Build and Run tests
run: |
mkdir $BISECT_DIR
dune build @all @runtest
dune build @runtest --force --instrument-with bisect_ppx
env:
BISECT_DIR: ${{ runner.temp }}/_bisect_ppx_data
BISECT_FILE: ${{ runner.temp }}/_bisect_ppx_data/data
- name: Send coverage report to Coveralls
run: dune exec -- bisect-ppx-report send-to Coveralls --coverage-path $BISECT_DIR
env:
BISECT_DIR: ${{ runner.temp }}/_bisect_ppx_data
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PULL_REQUEST_NUMBER: ${{ github.event.number }}
- name: Lint
run: dune build @lint @fmt @unused-libs
- name: Build Doc
run: dune build @doc
# Before checking for uncommitted changes we need to restore changes
# potentially made to the dune-project file.
- name: Restore dune-project
run: git restore dune-project
- name: Check for uncommitted changes
run: git diff --exit-code