graph-parser.yml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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.10.1.727'
  25. # This is the same as 1.8.
  26. JAVA_VERSION: '8'
  27. # This is the latest node version we can run.
  28. NODE_VERSION: '16'
  29. BABASHKA_VERSION: '0.8.156'
  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/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/setup-clojure@master
  49. with:
  50. cli: ${{ env.CLOJURE_VERSION }}
  51. - name: Setup Babashka
  52. uses: turtlequeue/[email protected]
  53. with:
  54. babashka-version: ${{ env.BABASHKA_VERSION }}
  55. - name: Clojure cache
  56. uses: actions/cache@v3
  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: 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@v3
  81. - name: Set up Java
  82. uses: actions/setup-java@v3
  83. with:
  84. distribution: 'zulu'
  85. java-version: ${{ env.JAVA_VERSION }}
  86. - name: Set up Clojure
  87. uses: DeLaGuardo/setup-clojure@master
  88. with:
  89. cli: ${{ env.CLOJURE_VERSION }}
  90. - name: Setup Babashka
  91. uses: turtlequeue/[email protected]
  92. with:
  93. babashka-version: ${{ env.BABASHKA_VERSION }}
  94. - name: Run clj-kondo lint
  95. run: clojure -M:clj-kondo --parallel --lint src test
  96. - name: Carve lint for unused vars
  97. run: bb lint:carve 2>/dev/null
  98. - name: Lint for vars that are too large
  99. run: bb lint:large-vars 2>/dev/null
  100. - name: Lint for namespaces that aren't documented
  101. run: bb lint:ns-docstrings 2>/dev/null