99jobs :
1010 build :
1111 name : Build and test
12-
1312 runs-on : ubuntu-latest
14-
1513 env :
1614 MYSQL_DATABASE : test
1715 MYSQL_ROOT_PASSWORD : password
18-
1916 services :
2017 database :
2118 image : mariadb:10.6
@@ -24,74 +21,102 @@ jobs:
2421 MYSQL_ROOT_PASSWORD : ${{ env.MYSQL_ROOT_PASSWORD }}
2522 ports : ['3306:3306']
2623 options : --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
27-
2824 strategy :
2925 fail-fast : false
3026 matrix :
3127 ocaml-compiler :
32- - 4.14
33- - 5.2
34- - 5.3
28+ - " 4.14.3 "
29+ - " 5.2.1 "
30+ - " 5.3.0 "
3531
3632 steps :
37- - name : Checkout code
38- uses : actions/checkout@v4
39-
40- - name : Retrieve opam cache
41- uses : actions/cache@v4
42- if : runner.os != 'Windows'
43- id : cache-opam
44- with :
45- path : ~/.opam
46- key : v1-${{ runner.os }}-opam-${{ matrix.ocaml-compiler }}-${{ hashFiles('*.opam.locked') }}
33+ - name : Checkout repository
34+ uses : actions/checkout@v6
4735
48- - name : Use OCaml ${{ matrix.ocaml-version }}
36+ - name : Use OCaml ${{ matrix.ocaml-compiler }}
4937 uses : ocaml/setup-ocaml@v3
5038 with :
5139 ocaml-compiler : ${{ matrix.ocaml-compiler }}
5240 dune-cache : true
53- opam-pin : true
5441
5542 - name : Install system dependencies
5643 run : sudo apt-get update -y && sudo apt-get install -y libmariadb-dev
5744
5845 - name : Install dependencies
5946 run : opam install --deps-only --with-test --with-doc -y .
6047
61- - name : Recover from an Opam broken state
62- if : steps.cache-opam.outputs.cache-hit == 'true'
63- run : |
64- opam install -y dune
65- opam upgrade --fixup
66-
6748 - name : Build
68- run : |
69- make build
70-
71- - name : Check formatting
72- run : |
73- opam install -y ocamlformat
74- make format
49+ run : make build
7550
7651 - name : Run tests
7752 env :
7853 DATABASE_URL : mariadb://root:${{ env.MYSQL_ROOT_PASSWORD }}@127.0.0.1:3306/${{ env.MYSQL_DATABASE }}
7954 run : make test
8055
81- - name : Build documentation
82- run : |
83- make doc
56+ - uses : actions/upload-artifact@v6
57+ if : failure()
58+ with :
59+ name : tests-${{ matrix.ocaml-compiler }}
60+ path : _build/default/test/_build/_tests/
61+
62+ - name : Notify about failure
63+ if : failure()
64+ uses : ./.github/actions/notify-failure
65+ with :
66+ webhook : ${{ secrets.ECON_TEAMS_WEBHOOK }}
8467
85- - uses : actions/upload-artifact@v4
68+ lint-doc :
69+ runs-on : ubuntu-latest
70+ steps :
71+ - name : Checkout tree
72+ uses : actions/checkout@v6
73+ - name : Install system dependencies
74+ run : sudo apt-get update -y && sudo apt-get install -y libmariadb-dev
75+ - name : Set-up OCaml
76+ uses : ocaml/setup-ocaml@v3
8677 with :
87- name : documentation-${{ matrix.ocaml-compiler }}
78+ ocaml-compiler : 5.3.0
79+ opam-pin : true
80+ dune-cache : true
81+ - uses : ocaml/setup-ocaml/lint-doc@v3
82+ - uses : actions/upload-artifact@v6
83+ with :
84+ name : documentation
8885 path : _build/default/_doc/_html
8986
90- - uses : actions/upload-artifact@v4
87+ - name : Notify about failure
9188 if : failure()
89+ uses : ./.github/actions/notify-failure
9290 with :
93- name : tests-${{ matrix.ocaml-compiler }}
94- path : _build/default/test/_build/_tests/
91+ webhook : ${{ secrets.ECON_TEAMS_WEBHOOK }}
92+
93+ lint-fmt :
94+ runs-on : ubuntu-latest
95+ steps :
96+ - name : Checkout tree
97+ uses : actions/checkout@v6
98+ - name : Set-up OCaml
99+ uses : ocaml/setup-ocaml@v3
100+ with :
101+ ocaml-compiler : 5.3.0
102+ - uses : ocaml/setup-ocaml/lint-fmt@v3
103+
104+ - name : Notify about failure
105+ if : failure()
106+ uses : ./.github/actions/notify-failure
107+ with :
108+ webhook : ${{ secrets.ECON_TEAMS_WEBHOOK }}
109+
110+ lint-opam :
111+ runs-on : ubuntu-latest
112+ steps :
113+ - name : Checkout tree
114+ uses : actions/checkout@v6
115+ - name : Set-up OCaml
116+ uses : ocaml/setup-ocaml@v3
117+ with :
118+ ocaml-compiler : 5.3.0
119+ - uses : ocaml/setup-ocaml/lint-opam@v3
95120
96121 - name : Notify about failure
97122 if : failure()
@@ -102,17 +127,20 @@ jobs:
102127 deploy-doc :
103128 name : Deploy documentation
104129 runs-on : ubuntu-latest
105- needs : [build ]
130+ needs : [lint-doc ]
106131 if : github.ref == 'refs/heads/main'
107132 environment :
108133 name : github-pages
109134 url : ${{ steps.deploy-doc.outputs.page_url }}
110135 steps :
111136 - name : Checkout code
112- uses : actions/checkout@v4
137+ uses : actions/checkout@v6
113138
114- - name : Download all workflow run artifacts
115- uses : actions/download-artifact@v4
139+ - name : Download documentation artifact
140+ uses : actions/download-artifact@v8
141+ with :
142+ name : documentation
143+ path : documentation
116144
117145 - name : Deploy odoc to GitHub Pages
118146 uses : peaceiris/actions-gh-pages@v4
@@ -132,7 +160,7 @@ jobs:
132160 if : github.ref_type == 'tag'
133161 steps :
134162 - name : Checkout code
135- uses : actions/checkout@v4
163+ uses : actions/checkout@v6
136164
137165 - name : Extract version changelog
138166 run : sed -nr "/^## .?v?${GITHUB_REF_NAME}/,/^## /p" CHANGELOG.md | sed '1d;2d;$d' > changes.md
0 commit comments