Skip to content

Commit 668e0bf

Browse files
authored
Merge pull request #512 from objectstack-ai/copilot/optimize-ci-and-test-scripts
2 parents 61d52db + e53d7f7 commit 668e0bf

6 files changed

Lines changed: 57 additions & 48 deletions

File tree

.github/workflows/changeset-release.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ jobs:
3939
git config merge.pnpm-merge.name "pnpm-lock.yaml merge driver"
4040
git config merge.pnpm-merge.driver "pnpm install --no-frozen-lockfile"
4141
42+
- name: Turbo Cache
43+
uses: actions/cache@v5
44+
with:
45+
path: node_modules/.cache/turbo
46+
key: turbo-${{ runner.os }}-${{ github.sha }}
47+
restore-keys: |
48+
turbo-${{ runner.os }}-
49+
4250
- name: Install dependencies
4351
run: pnpm install --frozen-lockfile
4452

.github/workflows/ci.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ on:
66
pull_request:
77
branches: [main, develop]
88

9+
concurrency:
10+
group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
11+
cancel-in-progress: true
12+
913
jobs:
1014
test:
1115
name: Test
1216
runs-on: ubuntu-latest
13-
strategy:
14-
matrix:
15-
node-version: [20.x]
1617

1718
steps:
1819
- name: Checkout code
@@ -21,24 +22,19 @@ jobs:
2122
- name: Setup pnpm
2223
uses: pnpm/action-setup@v4
2324

24-
- name: Setup Node.js ${{ matrix.node-version }}
25+
- name: Setup Node.js
2526
uses: actions/setup-node@v6
2627
with:
27-
node-version: ${{ matrix.node-version }}
28+
node-version: '20.x'
2829
cache: 'pnpm'
2930

3031
- name: Install dependencies
3132
run: pnpm install --frozen-lockfile
3233

33-
- name: Run tests
34-
run: pnpm test
35-
36-
- name: Generate coverage report
37-
if: matrix.node-version == '20.x'
34+
- name: Run tests with coverage
3835
run: pnpm test:coverage
3936

4037
- name: Upload coverage to Codecov
41-
if: matrix.node-version == '20.x'
4238
uses: codecov/codecov-action@v5
4339
with:
4440
fail_ci_if_error: false
@@ -134,8 +130,8 @@ jobs:
134130
node-version: '20.x'
135131
cache: 'pnpm'
136132

137-
- name: Turbo Cache
138-
uses: actions/cache@v5
133+
- name: Restore Turbo Cache
134+
uses: actions/cache/restore@v5
139135
with:
140136
path: node_modules/.cache/turbo
141137
key: turbo-${{ runner.os }}-${{ github.sha }}
@@ -165,8 +161,12 @@ jobs:
165161
docs:
166162
name: Build Docs
167163
runs-on: ubuntu-latest
168-
# Optional: Only run if related files change (requires strict path filtering logic or reliance on turbo cache)
169-
# For now, we run it but as a separate parallel job so it doesn't block 'Build Core'
164+
if: >-
165+
github.event_name == 'push' ||
166+
(
167+
github.event_name == 'pull_request' &&
168+
!contains(github.event.pull_request.title, '[skip docs]')
169+
)
170170
171171
steps:
172172
- name: Checkout code

.github/workflows/performance-budget.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ on:
1414
- 'apps/console/**'
1515
- 'pnpm-lock.yaml'
1616

17+
concurrency:
18+
group: performance-budget-${{ github.event.pull_request.number || github.ref }}
19+
cancel-in-progress: true
20+
1721
permissions:
1822
contents: read
1923
pull-requests: write

.github/workflows/size-check.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
- 'packages/**/package.json'
1010
- 'pnpm-lock.yaml'
1111

12+
concurrency:
13+
group: size-check-${{ github.event.pull_request.number || github.ref }}
14+
cancel-in-progress: true
15+
1216
permissions:
1317
contents: read
1418
pull-requests: write
@@ -29,6 +33,14 @@ jobs:
2933
node-version: '20.x'
3034
cache: 'pnpm'
3135

36+
- name: Turbo Cache
37+
uses: actions/cache@v5
38+
with:
39+
path: node_modules/.cache/turbo
40+
key: turbo-${{ runner.os }}-${{ github.sha }}
41+
restore-keys: |
42+
turbo-${{ runner.os }}-
43+
3244
- name: Install dependencies
3345
run: pnpm install --frozen-lockfile
3446

.github/workflows/storybook-tests.yml

Lines changed: 14 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,27 @@ name: Storybook Tests
22
on:
33
push:
44
branches: [main, develop]
5+
paths:
6+
- 'packages/**'
7+
- '.storybook/**'
8+
- 'pnpm-lock.yaml'
59
pull_request:
610
branches: [main, develop]
11+
paths:
12+
- 'packages/**'
13+
- '.storybook/**'
14+
- 'pnpm-lock.yaml'
15+
16+
concurrency:
17+
group: storybook-tests-${{ github.event.pull_request.number || github.ref }}
18+
cancel-in-progress: true
719

820
permissions:
921
contents: read
1022

1123
jobs:
12-
storybook-build:
13-
name: Storybook Build
24+
storybook-test:
25+
name: Storybook Build & Test
1426
timeout-minutes: 30
1527
runs-on: ubuntu-latest
1628

@@ -42,37 +54,6 @@ jobs:
4254
- name: Build Storybook
4355
run: pnpm storybook:build
4456

45-
storybook-test:
46-
name: Storybook Test Runner
47-
timeout-minutes: 60
48-
runs-on: ubuntu-latest
49-
needs: storybook-build
50-
51-
steps:
52-
- uses: actions/checkout@v6
53-
54-
- name: Setup pnpm
55-
uses: pnpm/action-setup@v4
56-
57-
- uses: actions/setup-node@v6
58-
with:
59-
node-version: '20'
60-
cache: 'pnpm'
61-
62-
- name: Turbo Cache
63-
uses: actions/cache@v5
64-
with:
65-
path: node_modules/.cache/turbo
66-
key: turbo-${{ runner.os }}-${{ github.sha }}
67-
restore-keys: |
68-
turbo-${{ runner.os }}-
69-
70-
- name: Install dependencies
71-
run: pnpm install --frozen-lockfile
72-
73-
- name: Build packages
74-
run: pnpm build
75-
7657
- name: Install Playwright Browsers
7758
run: pnpm exec playwright install --with-deps chromium
7859

.github/workflows/visual-regression.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
- 'packages/layout/**'
1010
- '.storybook/**'
1111

12+
concurrency:
13+
group: visual-regression-${{ github.event.pull_request.number || github.ref }}
14+
cancel-in-progress: true
15+
1216
permissions:
1317
contents: read
1418

0 commit comments

Comments
 (0)