|
70 | 70 | path: ~/.cache/ms-playwright |
71 | 71 | key: playwright-${{ hashFiles('package-lock.json') }} |
72 | 72 |
|
| 73 | + test-build: |
| 74 | + name: 🏗️ Build for Tests |
| 75 | + needs: setup |
| 76 | + runs-on: ubuntu-latest |
| 77 | + if: github.ref != 'refs/heads/main' |
| 78 | + steps: |
| 79 | + - uses: actions/checkout@v4 |
| 80 | + with: |
| 81 | + submodules: true |
| 82 | + |
| 83 | + - uses: actions/setup-node@v4 |
| 84 | + with: |
| 85 | + node-version: ${{ env.NODE_VERSION }} |
| 86 | + cache: "npm" |
| 87 | + |
| 88 | + - name: Restore cached node_modules |
| 89 | + uses: actions/cache/restore@v4 |
| 90 | + with: |
| 91 | + path: node_modules |
| 92 | + key: node-modules-${{ hashFiles('package-lock.json') }} |
| 93 | + |
| 94 | + - name: Install dependencies (fallback) |
| 95 | + if: steps.cache-node-modules.outputs.cache-hit != 'true' |
| 96 | + run: npm ci |
| 97 | + |
| 98 | + - name: Build for tests |
| 99 | + env: |
| 100 | + VITE_DESCOPE_PROJECT_ID: ${{ secrets.VITE_DESCOPE_PROJECT_ID }} |
| 101 | + VITE_DISPLAY_CHATBOT: true |
| 102 | + run: npm run build |
| 103 | + |
| 104 | + - name: Upload test build |
| 105 | + uses: actions/upload-artifact@v4 |
| 106 | + with: |
| 107 | + name: test-built-files |
| 108 | + path: dist |
| 109 | + retention-days: 1 |
| 110 | + |
73 | 111 | test: |
74 | 112 | name: 🧪 ${{ matrix.browser }} (shard ${{ matrix.shard }}/4) |
75 | | - needs: [setup, build] |
| 113 | + needs: [setup, test-build] |
76 | 114 | runs-on: ubuntu-latest |
77 | 115 | if: github.ref != 'refs/heads/main' |
78 | 116 | timeout-minutes: 30 |
@@ -110,10 +148,10 @@ jobs: |
110 | 148 | path: ~/.cache/ms-playwright |
111 | 149 | key: playwright-${{ hashFiles('package-lock.json') }} |
112 | 150 |
|
113 | | - - name: Download built files |
| 151 | + - name: Download test build |
114 | 152 | uses: actions/download-artifact@v4 |
115 | 153 | with: |
116 | | - name: built-files |
| 154 | + name: test-built-files |
117 | 155 | path: ./dist |
118 | 156 |
|
119 | 157 | - name: Cache Docker images |
|
0 commit comments