-
Notifications
You must be signed in to change notification settings - Fork 26
147 lines (135 loc) · 4.54 KB
/
test.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: Cross-platform tests
on:
pull_request:
push:
branches:
- 'master'
jobs:
test-with-setup-ocaml:
strategy:
fail-fast: false
matrix:
os:
- windows-latest
- ubuntu-latest
- macos-latest
ocaml-compiler:
- '4.13.x'
runs-on: ${{ matrix.os }}
name: test-ocaml / ${{ matrix.os }}-${{ matrix.ocaml-compiler }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Hack Git CRLF for ocaml/setup-ocaml issue #529
if: ${{ startsWith(matrix.os, 'windows-') }}
run: |
& "C:\Program Files\Git\bin\git.exe" config --system core.autocrlf input
- name: OCaml ${{ matrix.ocaml-compiler }} with Dune cache
uses: ocaml/setup-ocaml@v2
if: ${{ !startsWith(matrix.os, 'windows-') }}
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
dune-cache: true
- name: OCaml ${{ matrix.ocaml-compiler }} without Dune cache
uses: ocaml/setup-ocaml@v2
if: ${{ startsWith(matrix.os, 'windows-') }}
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
dune-cache: false
- name: Install/build/test
run: |
opam install . --deps-only --with-test
opam exec -- dune build --display=short
opam exec -- dune runtest --display=short
setup-dkml:
uses: 'diskuv/dkml-workflows/.github/workflows/setup-dkml.yml@v0'
permissions: {} # remove all rights of GITHUB_TOKEN when it is passed to setup-dkml.yml
with:
ocaml-compiler: 4.12.1
test-with-setup-dkml:
needs: setup-dkml
strategy:
fail-fast: false
matrix:
include:
- os: windows-2019
abi-pattern: win32-windows_x86
dkml-host-abi: windows_x86
opam-root: D:/.opam
default_shell: msys2 {0}
msys2_system: MINGW32
msys2_packages: mingw-w64-i686-pkg-config
bits: "32"
- os: windows-2019
abi-pattern: win32-windows_x86_64
dkml-host-abi: windows_x86_64
opam-root: D:/.opam
default_shell: msys2 {0}
msys2_system: CLANG64
msys2_packages: mingw-w64-clang-x86_64-pkg-config
bits: "64"
- os: macos-latest
abi-pattern: macos-darwin_all
dkml-host-abi: darwin_x86_64
default_shell: sh
opam-root: /Users/runner/.opam
bits: "64"
- os: ubuntu-latest
abi-pattern: manylinux2014-linux_x86
bits: "32"
default_shell: sh
dkml-host-abi: linux_x86
opam-root: .ci/opamroot # local directory of $GITHUB_WORKSPACE so available to dockcross
- os: ubuntu-latest
abi-pattern: manylinux2014-linux_x86_64
bits: "64"
default_shell: sh
dkml-host-abi: linux_x86_64
opam-root: .ci/opamroot # local directory of $GITHUB_WORKSPACE so available to dockcross
runs-on: ${{ matrix.os }}
name: test-dkml / ${{ matrix.abi-pattern }}
defaults:
run:
shell: ${{ matrix.default_shell }}
env:
OPAMROOT: ${{ matrix.opam-root }}
COMPONENT: dkml-component-staging-opam${{ matrix.bits }}
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
path: .ci/dist
- name: Install MSYS2 (Windows)
if: startsWith(matrix.dkml-host-abi, 'windows_')
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.msys2_system }}
update: true
install: >-
${{ matrix.msys2_packages }}
wget
make
rsync
diffutils
patch
unzip
git
tar
- name: Import build environments from setup-dkml
run: |
${{ needs.setup-dkml.outputs.import_func }}
import ${{ matrix.abi-pattern }}
- name: Cache Opam downloads by host
uses: actions/cache@v3
with:
path: ${{ matrix.opam-root }}/download-cache
key: ${{ matrix.dkml-host-abi }}
- name: Install/build/test
run: |
# Fix dependencies to work with MSVC
# - alcotest.1.4.0 works with MSVC; 1.5.0 does not
opamrun pin alcotest -k version 1.4.0 --no-action --yes
opamrun install . --deps-only --with-test --yes
opamrun exec -- dune build --display=short
opamrun exec -- dune runtest --display=short