graph-parser.yml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. # db is a local dep that could break functionality in this lib and should trigger this
  10. - 'deps/db/**'
  11. - '.github/workflows/graph-parser.yml'
  12. - '!deps/graph-parser/**.md'
  13. pull_request:
  14. branches: [master]
  15. paths:
  16. - 'deps/graph-parser/**'
  17. - 'deps/db/**'
  18. - '.github/workflows/graph-parser.yml'
  19. - '!deps/graph-parser/**.md'
  20. defaults:
  21. run:
  22. working-directory: deps/graph-parser
  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: '20'
  29. BABASHKA_VERSION: '1.0.168'
  30. jobs:
  31. test:
  32. runs-on: ubuntu-latest
  33. steps:
  34. - name: Checkout
  35. uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
  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/graph-parser/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. - name: Set up Clojure
  48. uses: DeLaGuardo/[email protected]
  49. with:
  50. cli: ${{ env.CLOJURE_VERSION }}
  51. bb: ${{ env.BABASHKA_VERSION }}
  52. - name: Clojure cache
  53. uses: actions/cache@v3
  54. id: clojure-deps
  55. with:
  56. path: |
  57. ~/.m2/repository
  58. ~/.gitlibs
  59. key: ${{ runner.os }}-clojure-deps-${{ hashFiles('deps.edn') }}
  60. restore-keys: ${{ runner.os }}-clojure-deps-
  61. - name: Fetch Clojure deps
  62. if: steps.clojure-deps.outputs.cache-hit != 'true'
  63. run: clojure -A:test -P
  64. - name: Fetch yarn deps
  65. run: yarn install --frozen-lockfile
  66. - name: Run ClojureScript tests
  67. run: REPEATABLE_IDENTS=true clojure -M:test
  68. - name: Run nbb-logseq tests
  69. run: yarn test
  70. # In this job because it depends on an npm package
  71. - name: Load namespaces into nbb-logseq
  72. run: bb test:load-all-namespaces-with-nbb .
  73. lint:
  74. runs-on: ubuntu-latest
  75. steps:
  76. - name: Checkout
  77. uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
  78. - name: Set up Java
  79. uses: actions/setup-java@v3
  80. with:
  81. distribution: 'zulu'
  82. java-version: ${{ env.JAVA_VERSION }}
  83. - name: Set up Clojure
  84. uses: DeLaGuardo/[email protected]
  85. with:
  86. cli: ${{ env.CLOJURE_VERSION }}
  87. bb: ${{ env.BABASHKA_VERSION }}
  88. - name: Run clj-kondo lint
  89. run: clojure -M:clj-kondo --parallel --lint src test
  90. - name: Carve lint for unused vars
  91. run: bb lint:carve
  92. - name: Lint for vars that are too large
  93. run: bb lint:large-vars
  94. - name: Lint for namespaces that aren't documented
  95. run: bb lint:ns-docstrings