Skip to content

Commit 1acf389

Browse files
committed
[ci] add back package validation
1 parent 97be318 commit 1acf389

File tree

1 file changed

+128
-59
lines changed

1 file changed

+128
-59
lines changed

.github/workflows/main.yml

Lines changed: 128 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -129,20 +129,20 @@ jobs:
129129
name: scramjet
130130
path: |
131131
packages/scramjet/packages/core/dist/*
132-
frontend:
133-
name: Build Frontend
132+
133+
package-validation:
134+
name: Validate Package Structure
134135
runs-on: ubuntu-latest
135-
permissions: write-all
136136
needs: [build]
137137

138138
steps:
139139
- name: Checkout code
140140
uses: actions/checkout@v4
141-
with:
142-
submodules: recursive
143141

144142
- name: Setup pnpm
145143
uses: pnpm/action-setup@v4
144+
with:
145+
version: latest
146146

147147
- name: Setup Node.js
148148
uses: actions/setup-node@v4
@@ -156,65 +156,19 @@ jobs:
156156
- name: Get artifacts
157157
uses: actions/download-artifact@v4
158158
with:
159-
name: scramjet
160-
path: packages/scramjet/packages/core/dist
161-
162-
- name: Build Dreamland
163-
run: pnpm build:dreamland
164-
165-
# - name: Get Chii submodule commit hash
166-
# id: chii-hash
167-
# run: echo "hash=$(git submodule status chii | awk '{print $1}')" >> $GITHUB_OUTPUT
168-
169-
# - name: Cache Chii build output
170-
# id: chii-cache
171-
# uses: actions/cache@v4
172-
# with:
173-
# path: |
174-
# chii/public
175-
# chii/front_end/dist
176-
# key: chii-${{ runner.os }}-${{ steps.chii-hash.outputs.hash }}
177-
178-
# - name: Install Depot Tools
179-
# if: steps.chii-cache.outputs.cache-hit != 'true'
180-
# uses: newkdev/setup-depot-tools@v1.0.1
181-
182-
# - name: Initialize Chii front_end
183-
# if: steps.chii-cache.outputs.cache-hit != 'true'
184-
# run: |
185-
# cd chii
186-
# pnpm init:front_end
187-
188-
# - name: Build Chii
189-
# if: steps.chii-cache.outputs.cache-hit != 'true'
190-
# run: |
191-
# cd chii
192-
# pnpm build
193-
194-
- name: Build Frontend
195-
run: |
196-
SKIP_CORE=1 pnpm build
197-
VITE_PUTER_BRANDING=1 VITE_ISOLATION_ORIGIN="https://puter.zone" pnpm build:chrome
159+
name: packaged-scramjet
160+
path: .
198161

199-
- name: Upload Artifact (dist)
200-
uses: actions/upload-artifact@v4
201-
with:
202-
name: frontend
203-
path: |
204-
./packages/chrome/dist
162+
- name: Extract package
163+
run: tar xvf mercuryworkshop-scramjet-*.tgz package --strip-components=1
205164

206-
- name: Upload pages artifact
207-
uses: actions/upload-pages-artifact@v3
208-
with:
209-
path: "./packages/chrome/dist"
165+
- name: Run package validation tests
166+
run: pnpm test:package
210167

211-
- name: Deploy to github
212-
id: deployment
213-
uses: actions/deploy-pages@v4
214168
tests:
215169
name: Run Scramjet Tests
216170
runs-on: ubuntu-latest
217-
needs: build
171+
needs: [build, package-validation]
218172
env:
219173
PLAYWRIGHT_BROWSERS_PATH: .playwright-browsers
220174
steps:
@@ -262,7 +216,7 @@ jobs:
262216
rewritertests:
263217
name: "Run Rewriter Tests"
264218
runs-on: ubuntu-latest
265-
needs: [build]
219+
needs: [build, package-validation]
266220

267221
steps:
268222
- name: Checkout code
@@ -290,3 +244,118 @@ jobs:
290244
- name: Run Tests
291245
run: cargo test
292246
working-directory: packages/scramjet/packages/core/rewriter/native
247+
248+
frontend:
249+
name: Build Frontend
250+
runs-on: ubuntu-latest
251+
permissions: write-all
252+
needs: [build, package-validation]
253+
254+
steps:
255+
- name: Checkout code
256+
uses: actions/checkout@v4
257+
with:
258+
submodules: recursive
259+
260+
- name: Setup pnpm
261+
uses: pnpm/action-setup@v4
262+
263+
- name: Setup Node.js
264+
uses: actions/setup-node@v4
265+
with:
266+
node-version: "22"
267+
cache: "pnpm"
268+
269+
- name: Install dependencies
270+
run: pnpm install
271+
272+
- name: Get artifacts
273+
uses: actions/download-artifact@v4
274+
with:
275+
name: scramjet
276+
path: packages/scramjet/packages/core/dist
277+
278+
- name: Build Dreamland
279+
run: pnpm build:dreamland
280+
281+
# - name: Get Chii submodule commit hash
282+
# id: chii-hash
283+
# run: echo "hash=$(git submodule status chii | awk '{print $1}')" >> $GITHUB_OUTPUT
284+
285+
# - name: Cache Chii build output
286+
# id: chii-cache
287+
# uses: actions/cache@v4
288+
# with:
289+
# path: |
290+
# chii/public
291+
# chii/front_end/dist
292+
# key: chii-${{ runner.os }}-${{ steps.chii-hash.outputs.hash }}
293+
294+
# - name: Install Depot Tools
295+
# if: steps.chii-cache.outputs.cache-hit != 'true'
296+
# uses: newkdev/setup-depot-tools@v1.0.1
297+
298+
# - name: Initialize Chii front_end
299+
# if: steps.chii-cache.outputs.cache-hit != 'true'
300+
# run: |
301+
# cd chii
302+
# pnpm init:front_end
303+
304+
# - name: Build Chii
305+
# if: steps.chii-cache.outputs.cache-hit != 'true'
306+
# run: |
307+
# cd chii
308+
# pnpm build
309+
310+
- name: Build Frontend
311+
run: |
312+
SKIP_CORE=1 pnpm build
313+
VITE_PUTER_BRANDING=1 VITE_ISOLATION_ORIGIN="https://puter.zone" pnpm build:chrome
314+
315+
- name: Upload Artifact (dist)
316+
uses: actions/upload-artifact@v4
317+
with:
318+
name: frontend
319+
path: |
320+
./packages/chrome/dist
321+
322+
pages:
323+
name: Upload to Github Pages
324+
runs-on: ubuntu-latest
325+
# make sure to add rewritertests and tests, omitting them due to bugs currently
326+
needs: [frontend]
327+
permissions: write-all
328+
if: github.ref == 'refs/heads/main'
329+
330+
steps:
331+
- name: Checkout code
332+
uses: actions/checkout@v4
333+
334+
- name: Setup pnpm
335+
uses: pnpm/action-setup@v4
336+
with:
337+
version: latest
338+
339+
- name: Setup Node.js
340+
uses: actions/setup-node@v4
341+
with:
342+
node-version: "22"
343+
cache: "pnpm"
344+
345+
- name: Install dependencies
346+
run: pnpm install
347+
348+
- name: Get artifacts
349+
uses: actions/download-artifact@v4
350+
with:
351+
name: frontend
352+
path: "./packages/chrome/dist"
353+
354+
- name: Upload pages artifact
355+
uses: actions/upload-pages-artifact@v3
356+
with:
357+
path: "./packages/chrome/dist"
358+
359+
- name: Deploy to github
360+
id: deployment
361+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)