logseq-common.yml 2.6 KB

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