deps-db-sync.yml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. name: logseq/db-sync CI
  2. on:
  3. # Path filters ensure jobs only kick off if a change is made to db-sync or
  4. # its local dependencies
  5. push:
  6. branches: [master]
  7. paths:
  8. - 'deps/db-sync/**'
  9. - '.github/workflows/deps-db-sync.yml'
  10. - '!deps/db-sync/**.md'
  11. # Deps that logseq/db-sync depends on should trigger this workflow
  12. - 'deps/db/**'
  13. - 'deps/common/**'
  14. pull_request:
  15. branches: [master]
  16. paths:
  17. - 'deps/db-sync/**'
  18. - '.github/workflows/deps-db-sync.yml'
  19. - '!deps/db-sync/**.md'
  20. # Deps that logseq/db-sync depends on should trigger this workflow
  21. - 'deps/db/**'
  22. - 'deps/common/**'
  23. defaults:
  24. run:
  25. working-directory: deps/db-sync
  26. env:
  27. CLOJURE_VERSION: '1.11.1.1413'
  28. JAVA_VERSION: '21'
  29. # This is the latest node version we can run.
  30. NODE_VERSION: '22'
  31. BABASHKA_VERSION: '1.12.215'
  32. jobs:
  33. test:
  34. runs-on: ubuntu-latest
  35. steps:
  36. - name: Checkout
  37. uses: actions/checkout@v4
  38. - name: Set up Node
  39. uses: actions/setup-node@v4
  40. with:
  41. node-version: ${{ env.NODE_VERSION }}
  42. cache: 'yarn'
  43. cache-dependency-path: deps/db-sync/yarn.lock
  44. - name: Set up Java
  45. uses: actions/setup-java@v4
  46. with:
  47. distribution: 'zulu'
  48. java-version: ${{ env.JAVA_VERSION }}
  49. # Clojure needed for bb step
  50. - name: Set up Clojure
  51. uses: DeLaGuardo/[email protected]
  52. with:
  53. cli: ${{ env.CLOJURE_VERSION }}
  54. bb: ${{ env.BABASHKA_VERSION }}
  55. - name: Fetch yarn deps
  56. run: yarn install --frozen-lockfile
  57. - name: Run unit tests
  58. run: yarn test:node-adapter
  59. lint:
  60. runs-on: ubuntu-latest
  61. steps:
  62. - name: Checkout
  63. uses: actions/checkout@v4
  64. - name: Set up Java
  65. uses: actions/setup-java@v4
  66. with:
  67. distribution: 'zulu'
  68. java-version: ${{ env.JAVA_VERSION }}
  69. - name: Set up Clojure
  70. uses: DeLaGuardo/[email protected]
  71. with:
  72. cli: ${{ env.CLOJURE_VERSION }}
  73. bb: ${{ env.BABASHKA_VERSION }}
  74. - name: Run clj-kondo lint
  75. run: clojure -M:clj-kondo --lint src test
  76. - name: Carve lint for unused vars
  77. run: bb lint:carve
  78. - name: Lint for vars that are too large
  79. run: bb lint:large-vars