@@ -12,122 +12,108 @@ concurrency:
1212 cancel-in-progress : true
1313
1414jobs :
15- setup :
16- name : Setup
15+ lint :
16+ name : ⬣ ESLint
1717 runs-on : ubuntu-latest
18- outputs :
19- cache-hit : ${{ steps.cache-node-modules.outputs.cache-hit }}
2018 steps :
21- - uses : actions/checkout@v4
22- with :
23- fetch-depth : 2
19+ - name : ⬇️ Checkout repo
20+ uses : actions/checkout@v4
2421
25- - uses : pnpm/action-setup@v4
22+ - name : 📦 Install pnpm
23+ uses : pnpm/action-setup@v4
2624
27- - uses : actions/setup-node@v4
25+ - name : ⎔ Setup Node.js
26+ uses : actions/setup-node@v4
2827 with :
2928 node-version : 20
3029 cache : ' pnpm'
3130
32- - id : cache-node-modules
33- uses : actions/cache@v4
34- with :
35- path : |
36- node_modules
37- packages/*/node_modules
38- docs/node_modules
39- key : ${{ runner.os }}-modules-${{ hashFiles('**/pnpm-lock.yaml') }}
40- restore-keys : |
41- ${{ runner.os }}-modules-
42-
43- - id : cache-turbo
44- uses : actions/cache@v4
45- with :
46- path : .turbo
47- key : ${{ runner.os }}-turbo-${{ github.sha }}
48- restore-keys : |
49- ${{ runner.os }}-turbo-
50-
51- # Always run install to ensure all dependencies are available
52- # This ensures workspace packages like docs have their dependencies
53- - run : pnpm install --frozen-lockfile
54-
55- validate :
56- name : Validate
57- needs : setup
31+ - name : 📦 Install dependencies
32+ run : pnpm install --frozen-lockfile
33+
34+ - name : 🔬 Lint
35+ run : pnpm turbo run lint --affected
36+
37+ typecheck :
38+ name : ʦ TypeScript
5839 runs-on : ubuntu-latest
5940 steps :
60- - uses : actions/checkout@v4
61- with :
62- fetch-depth : 2
41+ - name : ⬇️ Checkout repo
42+ uses : actions/checkout@v4
6343
64- - uses : pnpm/action-setup@v4
44+ - name : 📦 Install pnpm
45+ uses : pnpm/action-setup@v4
6546
66- - uses : actions/setup-node@v4
47+ - name : ⎔ Setup Node.js
48+ uses : actions/setup-node@v4
6749 with :
6850 node-version : 20
6951 cache : ' pnpm'
7052
71- - uses : actions/cache@v4
72- with :
73- path : |
74- node_modules
75- packages/*/node_modules
76- docs/node_modules
77- key : ${{ runner.os }}-modules-${{ hashFiles('**/pnpm-lock.yaml') }}
78- restore-keys : |
79- ${{ runner.os }}-modules-
80-
81- - uses : actions/cache@v4
82- with :
83- path : .turbo
84- key : ${{ runner.os }}-turbo-${{ github.sha }}
85- restore-keys : |
86- ${{ runner.os }}-turbo-
87-
88- - run : pnpm turbo run lint --affected
89- - run : pnpm turbo run type-check --affected
90- - run : pnpm turbo run build --affected
91- - run : pnpm turbo run test --affected
92-
93- # Debug: Check what was built
94- - name : Check build output
95- run : |
96- echo "Checking packages directory structure:"
97- find packages -name "dist" -type d || echo "No dist directories found"
98- ls -la packages/*/dist 2>/dev/null || echo "No dist directories to list"
99-
100- - uses : actions/upload-artifact@v4
101- if : success()
102- with :
103- name : build-artifacts
104- path : packages/*/dist
105- if-no-files-found : warn
53+ - name : 📦 Install dependencies
54+ run : pnpm install --frozen-lockfile
55+
56+ - name : 🔎 Type check
57+ run : pnpm turbo run type-check --affected
10658
107- cache-build :
108- name : Cache Artifacts
109- needs : validate
59+ test :
60+ name : 🧪 Test
11061 runs-on : ubuntu-latest
111- if : success()
11262 steps :
113- - uses : actions/download-artifact@v4
114- id : download-artifacts
115- continue-on-error : true
63+ - name : ⬇️ Checkout repo
64+ uses : actions/checkout@v4
65+
66+ - name : 📦 Install pnpm
67+ uses : pnpm/action-setup@v4
68+
69+ - name : ⎔ Setup Node.js
70+ uses : actions/setup-node@v4
11671 with :
117- name : build-artifacts
118- path : packages
119-
120- - name : Check artifact download
121- run : |
122- if [[ "${{ steps.download-artifacts.outcome }}" == "success" ]]; then
123- echo "Artifacts downloaded successfully"
124- ls -la packages/
125- else
126- echo "No artifacts to download - this may be expected if no packages were built"
127- fi
128-
129- - uses : actions/cache@v4
130- if : steps.download-artifacts.outcome == 'success'
72+ node-version : 20
73+ cache : ' pnpm'
74+
75+ - name : 📦 Install dependencies
76+ run : pnpm install --frozen-lockfile
77+
78+ - name : 🧪 Run tests
79+ run : pnpm turbo run test --affected
80+
81+ build :
82+ name : 🏗 Build
83+ runs-on : ubuntu-latest
84+ steps :
85+ - name : ⬇️ Checkout repo
86+ uses : actions/checkout@v4
87+
88+ - name : 📦 Install pnpm
89+ uses : pnpm/action-setup@v4
90+
91+ - name : ⎔ Setup Node.js
92+ uses : actions/setup-node@v4
13193 with :
132- path : packages/*/dist
133- key : build-artifacts-${{ github.sha }}
94+ node-version : 20
95+ cache : ' pnpm'
96+
97+ - name : 📦 Install dependencies
98+ run : pnpm install --frozen-lockfile
99+
100+ - name : 🏗 Build packages
101+ run : pnpm turbo run build --affected
102+
103+ - name : 📄 Generate docs (validate examples)
104+ run : pnpm turbo run docgen --affected || echo "No docgen script found, skipping"
105+
106+ # All jobs must pass
107+ ci :
108+ name : ✅ CI
109+ runs-on : ubuntu-latest
110+ if : always()
111+ needs : [lint, typecheck, test, build]
112+ steps :
113+ - name : ✅ All jobs passed
114+ if : ${{ !(contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')) }}
115+ run : exit 0
116+
117+ - name : ❌ Some jobs failed
118+ if : ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
119+ run : exit 1
0 commit comments