Files
logseq/.github/workflows/build.yml
megayu 79c25837cb Migrate from yarn to pnpm (#12529)
* migrate yarn to pnpm

* chore: update pnpm version to 10.33.0 across all package.json files

* chore: update .npmrc and package.json for improved dependency management

* chore: unify Clojure, Node, and Java version in workflow files

* fix: enable shamefully-hoist for now and add electron, keytar to onlyBuiltDependencies

* feat: add cider/piggieback dependency and update nREPL middleware configuration to silence warnings

* ensure pnpm setup prior to node setup

* fix: update logseq/bb-tasks git SHA

* feat: add pnpm configuration for onlyBuiltDependencies in package.json

* feat: add onlyBuiltDependencies configuration for better-sqlite3 in pnpm settings

* chore: update pnpm lockfile

* fix: resolve merge conflicts

* fix: remove invisible characters from markdown headers

* fix: update .npmrc comments for clarity on lockfile usage

* Revert "feat: add cider/piggieback dependency and update nREPL middleware configuration to silence warnings"

This reverts commit 70a111936f.

* fix: remove invisible characters from various README files and add .editorconfig

* fix: clarify lockfile resolution process in SKILL.md

---------

Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
2026-04-24 23:40:25 +08:00

188 lines
5.1 KiB
YAML

name: CI
on:
push:
branches: [master]
paths-ignore:
- '*.md'
pull_request:
branches: [master]
paths-ignore:
- '*.md'
env:
CLOJURE_VERSION: '1.12.4.1618'
JAVA_VERSION: '21'
# This is the latest node version we can run.
NODE_VERSION: '24'
BABASHKA_VERSION: '1.12.215'
jobs:
typos:
name: Spell Check with Typos
runs-on: ubuntu-22.04
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v4
- name: Check spelling with custom config file
uses: crate-ci/typos@v1.16.8
with:
config: ./typos.toml
test:
strategy:
matrix:
operating-system: [ubuntu-22.04]
runs-on: ${{ matrix.operating-system }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: 10.33.0
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
cache-dependency-path: pnpm-lock.yaml
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{ env.JAVA_VERSION }}
- name: Set up Clojure
uses: DeLaGuardo/setup-clojure@13.5
with:
cli: ${{ env.CLOJURE_VERSION }}
- name: Clojure cache
uses: actions/cache@v4
id: clojure-deps
with:
path: |
~/.m2/repository
~/.gitlibs
key: ${{ runner.os }}-clojure-deps-${{ hashFiles('deps.edn') }}
restore-keys: ${{ runner.os }}-clojure-deps-
- name: Fetch Clojure deps
if: steps.clojure-deps.outputs.cache-hit != 'true'
run: clojure -A:cljs -P
- name: Fetch pnpm deps
run: pnpm install --frozen-lockfile
- name: Build test asset
run: clojure -M:test compile test
- name: Run ClojureScript query tests against basic query type
run: DB_QUERY_TYPE=basic node static/tests.js -r frontend.db.query-dsl-test
- name: Run ClojureScript tests
run: pnpm cljs:run-test
lint:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{ env.JAVA_VERSION }}
- name: Set up Clojure
uses: DeLaGuardo/setup-clojure@13.5
with:
cli: ${{ env.CLOJURE_VERSION }}
bb: ${{ env.BABASHKA_VERSION }}
- name: Run clj-kondo lint
run: clojure -M:clj-kondo --parallel --lint src
- name: Carve lint for unused vars
run: bb lint:carve
- name: Lint for vars that are too large
run: bb lint:large-vars
- name: Lint for namespaces that aren't documented
run: bb lint:ns-docstrings
- name: Lint invalid translation entries
run: bb lang:validate-translations
- name: Lint hardcoded user-facing strings
run: bb lang:lint-hardcoded
- name: Lint to keep worker independent of frontend
run: bb lint:worker-and-frontend-separate
db-graph-test:
strategy:
matrix:
operating-system: [ubuntu-latest]
runs-on: ${{ matrix.operating-system }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: 10.33.0
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
cache-dependency-path: |
deps/db/pnpm-lock.yaml
scripts/pnpm-lock.yaml
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{ env.JAVA_VERSION }}
- name: Set up Clojure
uses: DeLaGuardo/setup-clojure@13.5
with:
cli: ${{ env.CLOJURE_VERSION }}
bb: ${{ env.BABASHKA_VERSION }}
- name: Fetch scripts pnpm deps
run: cd scripts && pnpm install --frozen-lockfile
- name: Create DB graph with properties
run: cd scripts && pnpm exec nbb-logseq src/logseq/tasks/db_graph/create_graph_with_properties.cljs ./properties-graph
# TODO: Use a smaller, test-focused graph to test classes
- name: Create DB graph with classes
run: cd scripts && pnpm exec nbb-logseq src/logseq/tasks/db_graph/create_graph_with_schema_org.cljs ./schema-graph
- name: Fetch deps/db pnpm deps
run: cd deps/db && pnpm install --frozen-lockfile
# Can run from deps/db since all JS deps for this command are available in deps/db
- name: Validate created DB graphs
run: cd deps/db && pnpm exec nbb-logseq -cp src:../cli/src -m logseq.cli validate -g ../../scripts/properties-graph ../../scripts/schema-graph
- name: Export a created DB graph and confirm the export is idempotent
run: cd deps/db && pnpm exec nbb-logseq -cp src:../cli/src -m logseq.cli export-edn -g ../../scripts/properties-graph -f properties.edn --roundtrip