forked from ocaml/dune
-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (92 loc) · 3.31 KB
/
workflow.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
name: Main workflow
on:
- push
- pull_request
jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
# Please keep the list in sync with the minimal version of OCaml in
# dune-project, dune.opam.template and bootstrap.ml
ocaml-version:
- 4.13.1
skip_test:
- false
include:
- ocaml-version: 4.12.1
os: ubuntu-latest
skip_test: true
- ocaml-version: 4.11.1
os: ubuntu-latest
skip_test: true
- ocaml-version: 4.10.0
os: ubuntu-latest
skip_test: true
- ocaml-version: 4.09.1
os: ubuntu-latest
skip_test: true
- ocaml-version: 4.08.1
os: ubuntu-latest
skip_test: true
- ocaml-version: 4.04.2
os: ubuntu-latest
skip_test: true
configurator: true
- ocaml-version: 4.02.3
os: ubuntu-latest
skip_test: true
# We don't run tests on all versions of the Windows environment and on
# 4.02.3 and 4.07.1 in other environments
env:
# Note that this environment variable is recognized as a string by GitHub
# Actions, so the following doesn't actually work:
#
# if: env.SKIP_TEST
#
# To skip an action, the following should be used:
# if: ${{ env.SKIP_TEST != "false" }}
SKIP_TEST: ${{ matrix.skip_test }}
OCAML_VERSION: ${{ matrix.ocaml-version }}
OS: ${{ matrix.os }}
CONFIGURATOR: ${{ matrix.configurator }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Use OCaml ${{ matrix.ocaml-version }}
uses: ocaml/setup-ocaml@v1
with:
ocaml-version: ${{ matrix.ocaml-version }}
# git user needs to be configured for the following tests:
# otherlibs/build-info/test/run.t
# test/blackbox-tests/test-cases/dune-project-meta/run.t
# test/blackbox-tests/test-cases/subst/run.t
# test/expect-tests/vcs_tests.ml
- name: Set git user
run: |
git config --global user.name github-actions
git config --global user.email [email protected]
- run: opam exec -- ocaml .github/workflows/ci.ml pin
# Install ocamlfind-secondary and ocaml-secondary-compiler, if needed
- run: opam install ./dune.opam --deps-only --with-test
- run: brew install fswatch coreutils
if: env.OS == 'macos-latest'
# dune doesn't have any additional dependencies so we can build it right
# away this makes it possible to see build errors as soon as possible
- run: opam exec -- make dune.exe
# Ensure Dune can build itself
- run: opam exec -- ./dune.exe build -p dune --profile dune-bootstrap
- name: run test suite
run: opam exec -- ocaml .github/workflows/ci.ml test
if: env.SKIP_TEST != 'true'
- name: test source is well formatted
run: opam exec -- make fmt
if: env.OCAML_VERSION == '4.12.0' && env.OS == 'ubuntu-latest'
- name: build configurator
run: opam install ./dune-configurator.opam
if: env.CONFIGURATOR == 'true'