-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (75 loc) · 2.77 KB
/
Copy pathci.yml
File metadata and controls
93 lines (75 loc) · 2.77 KB
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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
DATASCRIPT_UPSTREAM_REPO: https://github.com/logseq/datascript.git
DATASCRIPT_UPSTREAM_COMMIT: 3f141af97b70e1f14c65eaa119acd822ebece37e
jobs:
test:
name: OCaml ${{ matrix.ocaml-compiler }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ocaml-compiler: ["5.2.1"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up OCaml
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
dune-cache: true
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "17"
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "24"
- name: Set up Clojure
uses: DeLaGuardo/setup-clojure@13.4
with:
cli: latest
lein: latest
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y libsqlite3-dev pkg-config
- name: Install OCaml dependencies
run: opam install . --deps-only --with-test -y
- name: Cache upstream DataScript
id: cache-upstream-datascript
uses: actions/cache@v4
with:
path: _ci/datascript
key: datascript-upstream-${{ runner.os }}-${{ env.DATASCRIPT_UPSTREAM_COMMIT }}
- name: Checkout upstream DataScript
if: steps.cache-upstream-datascript.outputs.cache-hit != 'true'
run: |
git clone "$DATASCRIPT_UPSTREAM_REPO" _ci/datascript
git -C _ci/datascript checkout "$DATASCRIPT_UPSTREAM_COMMIT"
- name: Build upstream DataScript JS bundle
if: steps.cache-upstream-datascript.outputs.cache-hit != 'true'
working-directory: _ci/datascript
run: lein with-profile test cljsbuild once release
- name: Verify upstream DataScript cache
run: |
test "$(git -C _ci/datascript rev-parse HEAD)" = "$DATASCRIPT_UPSTREAM_COMMIT"
test -f _ci/datascript/release-js/datascript.js
- name: Run tests
env:
UPSTREAM_DATASCRIPT_REPO: ${{ github.workspace }}/_ci/datascript
UPSTREAM_DATASCRIPT_JS: ${{ github.workspace }}/_ci/datascript/release-js/datascript.js
run: opam exec -- dune runtest
- name: Run memory benchmark
env:
UPSTREAM_DATASCRIPT_JS: ${{ github.workspace }}/_ci/datascript/release-js/datascript.js
run: opam exec -- script/memory_benchmark_vs_cljs.sh
- name: Run benchmark comparison
env:
UPSTREAM_DATASCRIPT_JS: ${{ github.workspace }}/_ci/datascript/release-js/datascript.js
run: opam exec -- script/benchmark_vs_cljs.sh