Skip to content

Commit dea3329

Browse files
Create modular CI workflow with dependencies and artifact sharing
- Replace separate platform workflows with single CI workflow - Use workflow dependencies (needs:) to sequence build β†’ test phases - Share WASM build artifacts between jobs to eliminate duplication - Enable Windows testing (previously disabled) - Use npm run wasm:build consistently across all workflows - Eliminate code duplication across platform-specific workflows Co-Authored-By: Dan Lynch <[email protected]>
1 parent 5171c85 commit dea3329

File tree

5 files changed

+72
-104
lines changed

5 files changed

+72
-104
lines changed

β€Ž.github/workflows/build-wasm.ymlβ€Ž

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,15 @@ jobs:
1616
node-version: '20.x'
1717
cache: 'yarn'
1818

19-
- name: Install and Build πŸš€
20-
run: |
21-
yarn
19+
- name: Install Dependencies 🧢
20+
run: yarn install
2221

23-
- name: Install Emscripten ✍🏻
24-
run: |
25-
sudo apt-get update
26-
sudo apt-get install cmake python3 python3-pip
27-
git clone --branch 3.1.59 --depth 1 https://github.com/emscripten-core/emsdk.git
28-
cd emsdk
29-
./emsdk install 3.1.59
30-
./emsdk activate 3.1.59
31-
source ./emsdk_env.sh
32-
33-
- name: Build with Emscripten πŸ—
34-
run: |
35-
source ./emsdk/emsdk_env.sh
36-
emmake make
37-
emmake make build
22+
- name: Build WASM πŸ—
23+
run: npm run wasm:build
3824

3925
- name: Archive production artifacts πŸ›
4026
uses: actions/upload-artifact@v4
4127
with:
42-
name: compiled-files
43-
path: wasm
28+
name: wasm-artifacts
29+
path: wasm/
30+
retention-days: 7

β€Ž.github/workflows/ci.ymlβ€Ž

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: CI πŸš€
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
push:
7+
branches: [main, master]
8+
workflow_dispatch:
9+
10+
jobs:
11+
build-wasm:
12+
name: Build WASM πŸ”§
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout Repository πŸ“₯
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Node.js 🌐
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: '20.x'
22+
cache: 'yarn'
23+
24+
- name: Install Dependencies 🧢
25+
run: yarn install
26+
27+
- name: Build WASM πŸ—
28+
run: npm run wasm:build
29+
30+
- name: Upload WASM Artifacts πŸ“¦
31+
uses: actions/upload-artifact@v4
32+
with:
33+
name: wasm-artifacts
34+
path: wasm/
35+
retention-days: 1
36+
37+
test:
38+
name: Test on ${{ matrix.os }} πŸ§ͺ
39+
needs: build-wasm
40+
strategy:
41+
matrix:
42+
os: [ubuntu-latest, macos-latest, windows-latest]
43+
fail-fast: false
44+
runs-on: ${{ matrix.os }}
45+
steps:
46+
- name: Checkout Repository πŸ“₯
47+
uses: actions/checkout@v4
48+
49+
- name: Setup Node.js 🌐
50+
uses: actions/setup-node@v4
51+
with:
52+
node-version: '20.x'
53+
cache: 'yarn'
54+
55+
- name: Install Dependencies 🧢
56+
run: yarn install
57+
58+
- name: Download WASM Artifacts πŸ“₯
59+
uses: actions/download-artifact@v4
60+
with:
61+
name: wasm-artifacts
62+
path: wasm/
63+
64+
- name: Run Tests πŸ”
65+
run: yarn test

β€Ž.github/workflows/run-tests-linux.ymlβ€Ž

Lines changed: 0 additions & 29 deletions
This file was deleted.

β€Ž.github/workflows/run-tests-mac.ymlβ€Ž

Lines changed: 0 additions & 29 deletions
This file was deleted.

β€Ž.github/workflows/run-tests-win.ymlβ€Ž

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
Β (0)