clj-rtc-e2e.yml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. name: Clojure RTC E2E
  2. on:
  3. push:
  4. branches: [master]
  5. paths:
  6. - 'clj-e2e/**'
  7. - '.github/workflows/clj-rtc-e2e.yml'
  8. - src/**
  9. - deps/**
  10. - packages/**
  11. pull_request:
  12. branches: [master]
  13. paths:
  14. - 'clj-e2e/**'
  15. - '.github/workflows/clj-rtc-e2e.yml'
  16. - src/**
  17. - deps/**
  18. - packages/**
  19. env:
  20. CLOJURE_VERSION: '1.11.1.1413'
  21. # This is the latest node version we can run.
  22. NODE_VERSION: '22'
  23. BABASHKA_VERSION: '1.0.168'
  24. jobs:
  25. build:
  26. name: Build
  27. runs-on: ubuntu-22.04
  28. if: "contains(github.event.head_commit.message, 'rtc')"
  29. steps:
  30. - name: Checkout
  31. uses: actions/checkout@v4
  32. - name: Set up Node
  33. uses: actions/setup-node@v4
  34. with:
  35. node-version: ${{ env.NODE_VERSION }}
  36. cache: 'yarn'
  37. cache-dependency-path: |
  38. yarn.lock
  39. - name: Set up Clojure
  40. uses: DeLaGuardo/[email protected]
  41. with:
  42. cli: ${{ env.CLOJURE_VERSION }}
  43. bb: ${{ env.BABASHKA_VERSION }}
  44. - name: Clojure cache
  45. uses: actions/cache@v4
  46. id: clojure-deps
  47. with:
  48. path: |
  49. ~/.m2/repository
  50. ~/.gitlibs
  51. key: ${{ runner.os }}-clojure-deps-${{ hashFiles('deps.edn') }}
  52. restore-keys: ${{ runner.os }}-clojure-deps-
  53. - name: Fetch Clojure deps
  54. if: steps.clojure-deps.outputs.cache-hit != 'true'
  55. run: clojure -A:cljs -P
  56. - name: Shadow-cljs cache
  57. uses: actions/cache@v4
  58. with:
  59. path: .shadow-cljs
  60. # ensure update cache every time
  61. key: ${{ runner.os }}-shadow-cljs-${{ github.sha }}
  62. # will match most recent upload
  63. restore-keys: |
  64. ${{ runner.os }}-shadow-cljs-
  65. - name: Fetch yarn deps
  66. run: yarn install
  67. env:
  68. PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: true
  69. # NOTE: require the app to be build with DEV-RELEASE flag
  70. - name: Prepare E2E test build
  71. run: |
  72. yarn gulp:build && clojure -M:cljs release app db-worker inference-worker --config-merge "{:closure-defines {frontend.config/DEV-RELEASE true}}" --debug && yarn webpack-app-build
  73. - name: Upload build artifact
  74. uses: actions/upload-artifact@v4
  75. with:
  76. name: static-build
  77. path: static/
  78. retention-days: 1
  79. test:
  80. name: Test ${{ matrix.test-task }}
  81. needs: build
  82. runs-on: ubuntu-22.04
  83. if: "contains(github.event.head_commit.message, 'rtc')"
  84. strategy:
  85. fail-fast: false
  86. matrix:
  87. test-task: [run-rtc-extra-test, run-rtc-extra-part2-test]
  88. steps:
  89. - name: Checkout
  90. uses: actions/checkout@v4
  91. - name: Set up Node
  92. uses: actions/setup-node@v4
  93. with:
  94. node-version: ${{ env.NODE_VERSION }}
  95. - name: Set up Clojure
  96. uses: DeLaGuardo/[email protected]
  97. with:
  98. cli: ${{ env.CLOJURE_VERSION }}
  99. bb: ${{ env.BABASHKA_VERSION }}
  100. - name: Clojure cache
  101. uses: actions/cache@v4
  102. with:
  103. path: |
  104. ~/.m2/repository
  105. ~/.gitlibs
  106. key: ${{ runner.os }}-clojure-deps-${{ hashFiles('deps.edn') }}
  107. restore-keys: ${{ runner.os }}-clojure-deps-
  108. - name: Download build artifact
  109. uses: actions/download-artifact@v4
  110. with:
  111. name: static-build
  112. path: static
  113. - name: Prepare public dir
  114. run: |
  115. rsync -avz --exclude node_modules --exclude android --exclude ios ./static/ ./public/
  116. ls -lR ./public
  117. - name: Run e2e tests
  118. run: cd clj-e2e && timeout 30m bb ${{ matrix.test-task }}
  119. - name: Collect screenshots
  120. if: ${{ failure() }}
  121. uses: actions/upload-artifact@v4
  122. with:
  123. name: e2e-screenshots-${{ matrix.test-task }}
  124. path: clj-e2e/e2e-dump/*
  125. retention-days: 1