build.yml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. name: CI
  2. on:
  3. push:
  4. branches: [master]
  5. paths-ignore:
  6. - '*.md'
  7. pull_request:
  8. branches: [master]
  9. paths-ignore:
  10. - '*.md'
  11. env:
  12. CLOJURE_VERSION: '1.10.1.727'
  13. jobs:
  14. test:
  15. strategy:
  16. matrix:
  17. operating-system: [ubuntu-latest]
  18. runs-on: ${{ matrix.operating-system }}
  19. steps:
  20. - name: Checkout
  21. uses: actions/checkout@v2
  22. with:
  23. fetch-depth: 1
  24. submodules: 'true'
  25. - name: Clojure cache
  26. uses: actions/cache@v2
  27. id: clojure-deps
  28. with:
  29. path: |
  30. ~/.m2/repository
  31. ~/.gitlibs
  32. key: ${{ runner.os }}-clojure-deps-${{ hashFiles('deps.edn') }}
  33. restore-keys: ${{ runner.os }}-clojure-deps-
  34. - name: Prepare Java
  35. uses: actions/setup-java@v1
  36. with:
  37. java-version: 1.8
  38. - name: Set up Node
  39. uses: actions/setup-node@v2
  40. with:
  41. node-version: 16
  42. - name: Install Clojure tools.deps
  43. uses: DeLaGuardo/setup-clojure@master
  44. with:
  45. cli: ${{ env.CLOJURE_VERSION }}
  46. - name: Fetch Clojure deps
  47. if: steps.clojure-deps.outputs.cache-hit != 'true'
  48. run: clojure -A:cljs -P
  49. - name: Get yarn cache directory path
  50. id: yarn-cache-dir-path
  51. run: echo "::set-output name=dir::$(yarn cache dir)"
  52. - name: yarn cache
  53. uses: actions/cache@v1
  54. id: yarn-cache
  55. with:
  56. path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
  57. key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
  58. restore-keys: |
  59. ${{ runner.os }}-yarn-
  60. - name: Fetch yarn deps
  61. run: yarn cache clean && yarn install
  62. - name: Run ClojureScript test
  63. run: |
  64. yarn cljs:test
  65. node static/tests.js
  66. - name: Run Playwright test
  67. run: |
  68. yarn release
  69. (cd static && yarn install && yarn rebuild:better-sqlite3)
  70. xvfb-run -- yarn e2e-test
  71. env:
  72. DEBUG: "pw:test"
  73. - name: Save test artifacts
  74. if: ${{ github.event_name == 'pull_request' && failure() }}
  75. uses: actions/upload-artifact@v2
  76. with:
  77. name: e2e-test-report
  78. path: artifacts.zip