Skip to content

Commit acb7076

Browse files
committed
refactor: ci test script add (#183)
1 parent 9c94e8d commit acb7076

File tree

4 files changed

+89
-61
lines changed

4 files changed

+89
-61
lines changed

.github/workflows/chromatic.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "Chromatic Deployment"
1+
name: Chromatic Deployment
22

33
on:
44
pull_request:
@@ -16,13 +16,12 @@ jobs:
1616
steps:
1717
- name: Checkout
1818
uses: actions/checkout@v4
19-
with:
20-
fetch-depth: 0
2119

2220
- name: Setup node
2321
uses: actions/setup-node@v4
2422
with:
25-
node-version: "18.17.x"
23+
node-version: 18
24+
cache: "yarn"
2625

2726
- name: Set yarn version
2827
id: set-version

.github/workflows/ci-preview.yml

Lines changed: 42 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: Preview CI
2+
23
env:
34
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
45
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
@@ -7,95 +8,110 @@ env:
78
NEXT_PUBLIC_SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
89
NEXT_PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.SUPABASE_ANON_KEY }}
910
NEXT_PUBLIC_SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.SUPABASE_SERVICE_ROLE_KEY }}
11+
1012
on:
1113
pull_request:
1214
branches:
1315
- develop
1416

1517
jobs:
16-
build:
18+
project-build:
1719
runs-on: ubuntu-latest
1820
steps:
1921
- name: Checkout
2022
uses: actions/checkout@v4
2123

22-
- name: Setup Node.js environment
24+
- name: Setup node
2325
uses: actions/setup-node@v4
2426
with:
2527
node-version: 18
2628
cache: "yarn"
2729

28-
- name: Get yarn cache directory path
29-
id: yarn-cache-dir-path
30-
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
30+
- name: Set yarn version
31+
id: set-version
32+
run: |
33+
yarn set version 4.1.1
34+
echo "YARN_VERSION=$(yarn -v)" >> $GITHUB_OUTPUT
3135
32-
- uses: actions/cache@v4
33-
id: yarn-cache
36+
- name: Yarn cache - PnP
37+
uses: actions/cache@v4
3438
with:
35-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
36-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
39+
path: |
40+
.yarn/cache
41+
.pnp.*
42+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-${{ steps.set-version.outputs.YARN_VERSION }}
3743
restore-keys: |
38-
${{ runner.os }}-yarn-
44+
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-
3945
4046
- name: Install dependencies
4147
run: yarn
4248

43-
- name: Build
49+
- name: Run build
4450
run: yarn build
4551

46-
deploy-vercel:
52+
- name: Run unit test
53+
run: yarn test
54+
55+
deploy-to-vercel:
4756
runs-on: ubuntu-latest
4857
outputs:
4958
statis: ${{ job.status }}
5059
preview_url: ${{ steps.vercel_preview_url.outputs.preview_url }}
5160
currnent_time: ${{ steps.current-time.outputs.formattedTime }}
52-
needs: build
61+
needs: project-build
5362
steps:
5463
- name: Checkout
5564
uses: actions/checkout@v4
5665

57-
- name: Setup Node.js environment
66+
- name: Setup node
5867
uses: actions/setup-node@v4
5968
with:
6069
node-version: 18
6170
cache: "yarn"
6271

63-
- name: Get yarn cache directory path
64-
id: yarn-cache-dir-path
65-
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
72+
- name: Set yarn version
73+
id: set-version
74+
run: |
75+
yarn set version 4.1.1
76+
echo "YARN_VERSION=$(yarn -v)" >> $GITHUB_OUTPUT
6677
67-
- uses: actions/cache@v4
68-
id: yarn-cache
78+
- name: Yarn cache - PnP
79+
uses: actions/cache@v4
6980
with:
70-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
71-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
81+
path: |
82+
.yarn/cache
83+
.pnp.*
84+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-${{ steps.set-version.outputs.YARN_VERSION }}
7285
restore-keys: |
73-
${{ runner.os }}-yarn-
86+
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-
7487
7588
- name: Install dependencies
7689
run: yarn
7790

78-
- name: Deploy to Vercel if needed
91+
- name: Deploy to Vercel
7992
run: |
8093
npm install --global vercel@latest
8194
vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
8295
vercel build --token=${{ secrets.VERCEL_TOKEN }}
8396
vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}
84-
- name: Get Vercel Preview
97+
98+
- name: Get vercel preview
8599
uses: zentered/[email protected]
86100
id: vercel_preview_url
101+
87102
- name: Get URL
88103
run: echo "https://${{ steps.vercel_preview_url.outputs.preview_url }}"
104+
89105
- name: Get current time
90106
uses: josStorer/get-current-time@v2
91107
id: current-time
92108
with:
93109
format: "YYYY년 MM월 DD일 HH시 mm분"
94110
utcOffset: "+09:00"
95111

96-
github-deploy-comment:
112+
github-privew-comment:
97113
runs-on: ubuntu-latest
98-
needs: [deploy-vercel]
114+
needs: [deploy-to-vercel]
99115
steps:
100116
- name: Comment PR
101117
uses: thollander/actions-comment-pull-request@v3

.github/workflows/ci-production.yml

Lines changed: 36 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: Production CI
2+
23
env:
34
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
45
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
@@ -7,6 +8,7 @@ env:
78
NEXT_PUBLIC_SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
89
NEXT_PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.SUPABASE_ANON_KEY }}
910
NEXT_PUBLIC_SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.SUPABASE_SERVICE_ROLE_KEY }}
11+
1012
on:
1113
push:
1214
branches:
@@ -16,65 +18,76 @@ on:
1618
- develop
1719

1820
jobs:
19-
build:
21+
project-build:
2022
runs-on: ubuntu-latest
2123
steps:
2224
- name: Checkout
2325
uses: actions/checkout@v4
2426

25-
- name: Setup Node.js environment
27+
- name: Setup node
2628
uses: actions/setup-node@v4
2729
with:
2830
node-version: 18
2931
cache: "yarn"
3032

31-
- name: Get yarn cache directory path
32-
id: yarn-cache-dir-path
33-
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
33+
- name: Set yarn version
34+
id: set-version
35+
run: |
36+
yarn set version 4.1.1
37+
echo "YARN_VERSION=$(yarn -v)" >> $GITHUB_OUTPUT
3438
35-
- uses: actions/cache@v4
36-
id: yarn-cache
39+
- name: Yarn cache - PnP
40+
uses: actions/cache@v4
3741
with:
38-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
39-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
42+
path: |
43+
.yarn/cache
44+
.pnp.*
45+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-${{ steps.set-version.outputs.YARN_VERSION }}
4046
restore-keys: |
41-
${{ runner.os }}-yarn-
47+
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-
4248
4349
- name: Install dependencies
4450
run: yarn
4551

46-
- name: Build
52+
- name: Run build
4753
run: yarn build
4854

49-
deploy-vercel:
55+
- name: Run unit test
56+
run: yarn test
57+
58+
deploy-to-vercel:
5059
runs-on: ubuntu-latest
51-
needs: build
60+
needs: project-build
5261
steps:
5362
- name: Checkout
5463
uses: actions/checkout@v4
5564

56-
- name: Setup Node.js environment
65+
- name: Setup node
5766
uses: actions/setup-node@v4
5867
with:
5968
node-version: 18
6069
cache: "yarn"
6170

62-
- name: Get yarn cache directory path
63-
id: yarn-cache-dir-path
64-
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
71+
- name: Set yarn version
72+
id: set-version
73+
run: |
74+
yarn set version 4.1.1
75+
echo "YARN_VERSION=$(yarn -v)" >> $GITHUB_OUTPUT
6576
66-
- uses: actions/cache@v4
67-
id: yarn-cache
77+
- name: Yarn cache - PnP
78+
uses: actions/cache@v4
6879
with:
69-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
70-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
80+
path: |
81+
.yarn/cache
82+
.pnp.*
83+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-${{ steps.set-version.outputs.YARN_VERSION }}
7184
restore-keys: |
72-
${{ runner.os }}-yarn-
85+
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-
7386
7487
- name: Install dependencies
7588
run: yarn
7689

77-
- name: Deploy to Vercel if needed
90+
- name: Deploy to Vercel
7891
run: |
7992
npm install --global vercel@latest
8093
vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}

playwright.config.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ export default defineConfig({
3232
name: "chromium",
3333
use: { ...devices["Desktop Chrome"] },
3434
},
35-
{
36-
name: "firefox",
37-
use: { ...devices["Desktop Firefox"] },
38-
},
35+
// {
36+
// name: "firefox",
37+
// use: { ...devices["Desktop Firefox"] },
38+
// },
3939

40-
{
41-
name: "webkit",
42-
use: { ...devices["Desktop Safari"] },
43-
},
40+
// {
41+
// name: "webkit",
42+
// use: { ...devices["Desktop Safari"] },
43+
// },
4444
],
4545
});

0 commit comments

Comments
 (0)