graph-parser.yml 3.1 KB

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