-
Notifications
You must be signed in to change notification settings - Fork 27
130 lines (116 loc) · 3.28 KB
/
build.yml
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
---
name: Build
on:
push:
branches:
- master # forall push/merge in master
pull_request:
branches:
- "**" # forall submitted Pull Requests
jobs:
build:
strategy:
fail-fast: false
matrix:
setup-version:
- v2
- v3
os:
- macos-12
- macos-13
- macos-latest
- ubuntu-latest
- windows-latest
ocaml-version:
- 4.02.x
- 4.03.x
- 4.04.x
- 4.05.x
- 4.06.x
- 4.07.x
- 4.08.x
- 4.09.x
- 4.10.x
- 4.11.x
- 4.12.x
- 4.13.x
- 4.14.x
- 5.0.x
- 5.1.x
- 5.2.x
exclude:
- setup-version: v2
os: macos-latest
runs-on: ${{ matrix.os }}
env:
SKIP_BUILD: |
camlimages
dose
lilis
rotor
hdf5
pa_ppx
SKIP_TEST: |
0install
bisect_ppx
cconv-ppx
decompress
extlib-compat
General
steps:
- name: Prepare git
run: |
git config --global core.autocrlf false
git config --global init.defaultBranch master
- name: Checkout code
uses: actions/checkout@v4
- name: Setup OCaml ${{ matrix.ocaml-version }} with v2
if: matrix.setup-version == 'v2'
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: ${{ matrix.ocaml-version }}
- name: Setup OCaml ${{ matrix.ocaml-version }} with v3
if: matrix.setup-version == 'v3'
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: ${{ matrix.ocaml-version }}
- name: Install dependencies
run: opam install --deps-only .
- name: List installed packages
run: opam list
- name: Build locally
run: opam exec -- make
- name: Upload the build artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-${{ matrix.ocaml-version }}-cppo.exe
path: _build/default/src/cppo_main.exe
overwrite: true
- name: Build, test, and install package
run: opam install -t .
- name: Test dependants
if: >
(matrix.ocaml-version >= '4.05')
shell: bash
run: |
PACKAGES=`opam list -s --color=never --installable --depends-on cppo,cppo_ocamlbuild`
echo "Dependants:" $PACKAGES
for PACKAGE in $PACKAGES
do
echo $SKIP_BUILD | tr ' ' '\n' | grep ^$PACKAGE$ > /dev/null &&
echo Skip $PACKAGE && continue
OPAMWITHTEST=true
echo $SKIP_TEST | tr ' ' '\n' | grep ^$PACKAGE$ > /dev/null &&
OPAMWITHTEST=false
([ $OPAMWITHTEST == false ] &&
echo ::group::Build $PACKAGE) ||
echo ::group::Build and test $PACKAGE
DEPS_FAILED=false
(opam depext $PACKAGE &&
opam install --deps-only -t $PACKAGE) || DEPS_FAILED=true
[ $DEPS_FAILED == false ] && opam install $PACKAGE
echo ::endgroup::
[ $DEPS_FAILED == false ] || echo Dependencies broken
done
- name: Uninstall package
run: opam uninstall .