-
-
Notifications
You must be signed in to change notification settings - Fork 0
147 lines (121 loc) · 4.11 KB
/
test_suite.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
# This is a basic workflow to help you get started with Actions
name: TestSuite
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
# schedule:
# - cron: '15 * * * *'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-22.04
ocaml-compiler:
- 4.14.1
runs-on: ${{ matrix.os }}
env:
USERNAME: "vim"
USER_UID: 1000
USER_GID: 1000
container:
image: ocaml/opam:${{ matrix.os }}
options: --user root
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v2
with:
dune-cache: true
ocaml-compiler: ${{ matrix.ocaml-compiler }}
opam-disable-sandboxing: true
- name: List all .opam files
run: find . -name "*.opam"
- name: Cache opam dependencies
uses: actions/cache@v2
id: opam-cache
with:
path: ~/.opam
key: ${{ runner.os }}-opam-${{ hashFiles('**/*.opam') }}
restore-keys: |
${{ runner.os }}-opam-
- name: Install Common Libs
run: opam install async base uri cohttp cohttp-lwt-unix cohttp-async httpaf httpaf-lwt-unix lwt core_kernel ssl sqlite3 lwt_ssl jose js_of_ocaml-compiler alcotest alcotest-lwt qcheck dune ocamlformat
# - name: Install Repo
# run: opam install . --deps-only --with-doc --with-test
- name: Dune Build
run: opam exec -- dune build
env:
LIBSQL_TOKEN: ${{ secrets.LIBSQL_TOKEN }}
LIBSQL_HOST: ${{ secrets.LIBSQL_HOST }}
LIBSQL_PORT: ${{ secrets.LIBSQL_PORT }}
- name: install rust
run: curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh -s -- -y && . "$HOME/.cargo/env"
- name: sqld deps
run: apt-get update && apt-get install gcc g++ make libclang-dev -y
- name: sqld Build
run: git clone https://github.com/libsql/sqld.git && cd sqld && sed -i 's/setup_14/setup_18/g' ./scripts/install-deps.sh && ./scripts/install-deps.sh && . "$HOME/.cargo/env" && cargo build && ./target/debug/sqld --http-listen-addr 0.0.0.0:8000 &
env:
LIBSQL_HOST: ${{ secrets.LIBSQL_HOST }}
LIBSQL_PORT: ${{ secrets.LIBSQL_PORT }}
- name: Dune Test
run: opam exec -- dune runtest 2>&1 | tee dune_runtest.log
env:
LIBSQL_TOKEN: ${{ secrets.LIBSQL_TOKEN }}
LIBSQL_HOST: ${{ secrets.LIBSQL_HOST }}
LIBSQL_PORT: ${{ secrets.LIBSQL_PORT }}
- name: Upload Log
uses: actions/upload-artifact@v2
with:
name: dune_runtest
path: dune_runtest.log
lint-doc:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-22.04
ocaml-compiler:
- 4.14.1
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v2
with:
dune-cache: true
ocaml-compiler: ${{ matrix.ocaml-compiler }}
opam-disable-sandboxing: true
- name: Lint doc
uses: ocaml/setup-ocaml/lint-doc@v2
lint-fmt:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-22.04
ocaml-compiler:
- 4.14.1
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v2
with:
dune-cache: true
ocaml-compiler: ${{ matrix.ocaml-compiler }}
opam-disable-sandboxing: true
- name: Lint fmt
uses: ocaml/setup-ocaml/lint-fmt@v2