Move rules into db dep as it's useful for external apps

- rules is already used by logseq-query and will be useful for
  nbb-logseq
- Updated db jobs to run in deps/db by default. Less typing but
  more importantly discourages independent libraries from depending on
  external scripts.
- Moved lint-rules task into db since it is db specific now
- Also remove nbb-logseq from top-level as all nbb compatibility is in
  deps.
This commit is contained in:
Gabriel Horner
2022-06-08 12:33:10 -04:00
committed by Tienson Qin
parent 6608537909
commit 17d2462343
13 changed files with 27 additions and 85 deletions

View File

@@ -13,6 +13,10 @@ on:
- 'deps/db/**'
- '!deps/db/**.md'
defaults:
run:
working-directory: deps/db
env:
CLOJURE_VERSION: '1.10.1.727'
# setup-java@v2 dropped support for legacy Java version syntax.
@@ -50,11 +54,11 @@ jobs:
bb: ${{ env.BABASHKA_VERSION }}
- name: Fetch yarn deps
run: cd deps/db && yarn install --frozen-lockfile
run: yarn install --frozen-lockfile
# In this job because it depends on an npm package
- name: Load namespaces into nbb-logseq
run: bb test:load-all-namespaces-with-nbb deps/db
run: cd ../.. && bb test:load-all-namespaces-with-nbb deps/db
lint:
runs-on: ubuntu-latest
@@ -76,10 +80,13 @@ jobs:
bb: ${{ env.BABASHKA_VERSION }}
- name: Run clj-kondo lint
run: cd deps/db && clojure -M:clj-kondo --parallel --lint src
run: clojure -M:clj-kondo --parallel --lint src
- name: Carve lint for unused vars
run: cd deps/db && ../../scripts/carve.clj
run: ../../scripts/carve.clj
- name: Lint for vars that are too large
run: scripts/large_vars.clj deps/db/src '{:max-lines-count 30}'
run: ../../scripts/large_vars.clj src '{:max-lines-count 30}'
- name: Lint datalog rules
run: ../../scripts/lint_rules.clj