Skip to content

Commit 05a1228

Browse files
committed
[common-ui] add ci
1 parent cf585f9 commit 05a1228

File tree

1 file changed

+81
-0
lines changed

1 file changed

+81
-0
lines changed
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# vue-skuilder/.github/workflows/ci-pkg-common-ui.yml
2+
name: CI - Common UI Package
3+
4+
on:
5+
push:
6+
branches: [main]
7+
paths:
8+
- 'packages/common-ui/**'
9+
- 'packages/common/**'
10+
- 'packages/db/**'
11+
- '.github/workflows/ci-pkg-common-ui.yml'
12+
pull_request:
13+
branches: [main]
14+
paths:
15+
- 'packages/common-ui/**'
16+
- 'packages/common/**'
17+
- 'packages/db/**'
18+
- '.github/workflows/ci-pkg-common-ui.yml'
19+
20+
jobs:
21+
build-and-test:
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
28+
- name: Set up Node.js
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: 18
32+
cache: 'yarn'
33+
34+
- name: Install dependencies
35+
run: yarn install --immutable
36+
37+
# Build dependencies first
38+
- name: Build common package
39+
run: |
40+
cd packages/common
41+
yarn build
42+
43+
- name: Build db package
44+
run: |
45+
cd packages/db
46+
yarn build
47+
48+
# Lint common-ui
49+
- name: Lint common-ui
50+
run: |
51+
cd packages/common-ui
52+
yarn lint:check
53+
54+
# Build common-ui
55+
- name: Build common-ui
56+
run: |
57+
cd packages/common-ui
58+
yarn build
59+
60+
# Run unit tests
61+
- name: Run unit tests
62+
run: |
63+
cd packages/common-ui
64+
yarn test:unit
65+
66+
# Run component tests
67+
- name: Run Cypress component tests
68+
run: |
69+
cd packages/common-ui
70+
yarn cypress:run --component
71+
72+
# Archive test artifacts if tests fail
73+
- name: Archive Cypress screenshots and videos
74+
uses: actions/upload-artifact@v4
75+
if: failure()
76+
with:
77+
name: cypress-artifacts
78+
path: |
79+
packages/common-ui/cypress/screenshots
80+
packages/common-ui/cypress/videos
81+
retention-days: 7

0 commit comments

Comments
 (0)