cli.yml 2.7 KB

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