This repository has been archived by the owner on Jul 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
115 lines (94 loc) · 3.71 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
# SPDX-FileCopyrightText: Copyright 2023 Roland Csaszar
# SPDX-License-Identifier: MIT
#
# Project: OCaml-Buck-2-Examples
# File: test.yml
# Date: 12.Nov.2023
#
# ==============================================================================
name: Test
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
# windows:
# strategy:
# matrix:
# os: [windows-latest]
# dir: [basic_example, ppx_usage_example, inline_test_runners, ocamllex_menhir_example]
# ocaml: [ocaml.5.0.0]
# runs-on: ${{ matrix.os }}
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# - name: Install Buck 2
# uses: dtolnay/install-buck2@latest
# - name: Set-up OCaml
# uses: ocaml/setup-ocaml@v2
# with:
# ocaml-compiler: ${{ matrix.ocaml }},ocaml-option-mingw
# opam-repositories: |
# dra27: https://github.com/dra27/opam-repository.git#windows-5.0
# default: https://github.com/fdopen/opam-repository-mingw.git#opam2
# - name: Update Submodules and ocaml-scripts
# run: |
# git submodule update --init --depth 1
# git clone https://github.com/facebook/ocaml-scripts.git --depth 1
# - name: Install Opam Packages
# run: |
# opam install menhir ocamlfind menhirLib qcheck-alcotest alcotest ppx_inline_alcotest sedlex
# - name: Run dromedary
# run: |
# cd ${{ matrix.dir }}
# opam exec -- python3 ../ocaml-scripts/dromedary.py -o third-party/BUCK
# - name: Run Tests
# run: |
# cd ${{ matrix.dir }}
# opam exec -- buck2 run :test
unix:
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
dir: [basic_example, ppx_usage_example, inline_test_runners, ocamllex_menhir_example]
ocaml: [ocaml.5.1.0]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set-up OCaml
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: ${{ matrix.ocaml }}
opam-disable-sandboxing: true
opam-pin: false
opam-depext: false
- name: Update Submodules and ocaml-scripts
run: |
git submodule update --init --depth 1
git clone https://github.com/facebook/ocaml-scripts.git --depth 1
- name: Install Opam Packages
shell: python
run: |
import json
import subprocess
import sys
file_names = ["${{ matrix.dir }}/third-party/dromedary.json"]
cmd = ["opam", "install", "menhir", "ocamlfind"]
for file_name in file_names:
with open(file_name, "rt", encoding="utf-8") as fd:
package_list = json.load(fd)
cmd.extend(package_list["packages"])
subprocess.run(cmd)
- name: Run dromedary
run: |
eval $(opam env --set-switch)
cd ${{ matrix.dir }}
opam exec -- python3 ../ocaml-scripts/dromedary.py -o third-party/BUCK
- name: Install Buck 2
uses: dtolnay/install-buck2@latest
- name: Run Tests
run: |
cd ${{ matrix.dir }}
opam exec -- buck2 run :test