graph-parser.yml 2.9 KB

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