55 pull_request :
66
77jobs :
8- # 1️⃣ Build the package and publish it as an artifact
8+ # ─────────────────────────────────────────────────────
9+ # 1. Build the library and create the .tgz once
10+ # ─────────────────────────────────────────────────────
911 pack :
1012 runs-on : ubuntu-latest
1113
1214 steps :
13- - name : ⬇️ Check out code
15+ - name : ⬇️ Check out code
1416 uses : actions/checkout@v4
1517
16- - name : 🟢 Set up Node 20
18+ - name : 🟢 Set up Node 20
1719 uses : actions/setup-node@v4
1820 with :
1921 node-version : 20.x
22+ cache : npm
2023
21- - name : 📦 Install, build, pack
24+ - name : 📦 Install deps , build, pack
2225 run : |
2326 npm ci
2427 npm run build
25- npm pack
28+ npm pack # ⇠ generates imagekit-vue-*.tgz in $GITHUB_WORKSPACE
2629 env :
2730 CI : true
2831
29- - name : 📤 Upload .tgz artifact
32+ - name : 📤 Upload package artifact
3033 uses : actions/upload-artifact@v4
3134 with :
3235 name : imagekit-package
33- path : imagekit-vue-*.tgz
36+ path : imagekit-vue-*.tgz # uploads exactly one .tgz
3437
35- # 2️⃣ Matrix job: run E2E tests for each demo app in parallel
38+ # ─────────────────────────────────────────────────────
39+ # 2. Matrix: run demo-app tests in parallel
40+ # ─────────────────────────────────────────────────────
3641 test :
37- needs : pack # wait for the pack job
42+ needs : pack # wait for the tarball
3843 runs-on : ubuntu-latest
3944
4045 strategy :
4146 matrix :
42- app : [vue-ts, nuxt] # folders inside test-apps
47+ app : [vue-ts, nuxt] # sub- folders in test-apps
4348
4449 steps :
45- - name : ⬇️ Check out code
50+ - name : ⬇️ Check out code
4651 uses : actions/checkout@v4
4752
48- - name : 🟢 Set up Node 20
53+ - name : 🟢 Set up Node 20
4954 uses : actions/setup-node@v4
5055 with :
5156 node-version : 20.x
57+ cache : npm
5258
53- - name : 📥 Download package artifact
59+ - name : 📥 Download package artifact
5460 uses : actions/download-artifact@v4
5561 with :
56- name : imagekit-package
57- path : ./
62+ name : imagekit-package # puts .tgz into $GITHUB_WORKSPACE by default
5863
59- - name : 🔧 Install app deps + local package
64+ - name : 🔧 Install demo- app deps + local package
6065 run : |
6166 cd test-apps/${{ matrix.app }}
6267 npm ci
63- npm install ../../imagekit-vue-*.tgz --no-save
64- - name : 🧑💻 Install Playwright browsers
68+ # install your freshly-packed tarball from the workspace root
69+ npm install "${{ github.workspace }}/imagekit-vue-*.tgz" --no-save
70+
71+ - name : 🧑💻 Install Playwright browsers
6572 run : npx playwright install --with-deps
6673
67- - name : 🚀 Run E2E tests
74+ - name : 🚀 Run E2E tests
6875 run : npm run test:e2e
6976 env :
70- CI : true
77+ CI : true
0 commit comments