Repository navigation
chore: pin deps to logseq org forks #124
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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.5.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: Restore opam switch cache | |
| id: opam-cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: ~/.opam | |
| key: ${{ runner.os }}-ocaml-${{ matrix.ocaml-compiler }}-opam-${{ hashFiles('*.opam') }} | |
| restore-keys: | | |
| ${{ runner.os }}-ocaml-${{ matrix.ocaml-compiler }}-opam- | |
| - name: Install OCaml dependencies | |
| run: opam install . --deps-only --with-test -y | |
| - name: Save opam switch cache | |
| if: steps.opam-cache.outputs.cache-hit != 'true' | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: ~/.opam | |
| key: ${{ steps.opam-cache.outputs.cache-primary-key }} | |
| - 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 |