logseq-common.yml 2.7 KB

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