publishing.yml 2.7 KB

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