publishing.yml 2.6 KB

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