Skip to content

Commit 3afe09e

Browse files
committed
feat: introduce a dedicated test-build job and update the test job to consume its artifacts
1 parent e529db3 commit 3afe09e

1 file changed

Lines changed: 41 additions & 3 deletions

File tree

.github/workflows/build_test_and_release.yml

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,47 @@ jobs:
7070
path: ~/.cache/ms-playwright
7171
key: playwright-${{ hashFiles('package-lock.json') }}
7272

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+
73111
test:
74112
name: 🧪 ${{ matrix.browser }} (shard ${{ matrix.shard }}/4)
75-
needs: [setup, build]
113+
needs: [setup, test-build]
76114
runs-on: ubuntu-latest
77115
if: github.ref != 'refs/heads/main'
78116
timeout-minutes: 30
@@ -110,10 +148,10 @@ jobs:
110148
path: ~/.cache/ms-playwright
111149
key: playwright-${{ hashFiles('package-lock.json') }}
112150

113-
- name: Download built files
151+
- name: Download test build
114152
uses: actions/download-artifact@v4
115153
with:
116-
name: built-files
154+
name: test-built-files
117155
path: ./dist
118156

119157
- name: Cache Docker images

0 commit comments

Comments
 (0)