Skip to content

Commit ae213d6

Browse files
authored
chore: ci workflow 개선, 약간의 이미지 최적화 작업들, 부하테스트 (#316)
* feat: prefetch & ssr pages (#310-prefetch) * chore: ci improves and next.js add sharp (#ci-advancement) * feat(nx-cloud): setup nx cloud workspace (#315) This commit sets up Nx Cloud for your Nx workspace, enabling distributed caching and the Nx Cloud GitHub integration for fast CI and improved developer experience. You can access your Nx Cloud workspace by going to https://cloud.nx.app/orgs/679e78e771fd2cb4bf200e5c/workspaces/679e791071fd2cb4bf200e60 **Note:** This commit attempts to maintain formatting of the nx.json file, however you may need to correct formatting by running an nx format command and committing the changes. * chore: add cancel-in-progress: true (#ci-advancement) * fix: ci-app.yml fix (#ci-advancement) * chore: conflicts (#ci-advancement) * chore: update ci for using nx (#ci-advancement) * chore: next.js project에도 bundle analyze와 부하 테스트트 스크립트 추가 (#ci-advancement)
1 parent bcdd6a8 commit ae213d6

File tree

25 files changed

+6961
-255
lines changed

25 files changed

+6961
-255
lines changed

.github/actions/pnpm-install/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ runs:
77
- name: Setup pnpm
88
uses: pnpm/action-setup@v2
99
with:
10-
version: 8 # or your preferred version
10+
version: 8
1111

1212
- name: Get pnpm store directory
1313
id: pnpm-cache

.github/workflows/ci-app.yml

Lines changed: 0 additions & 72 deletions
This file was deleted.

.github/workflows/ci-nextjs.yml

Lines changed: 0 additions & 73 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: APP CI
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'services/**'
7+
- 'package.json'
8+
- 'pnpm-lock.yaml'
9+
- '.github/workflows/**'
10+
11+
permissions:
12+
actions: read
13+
contents: read
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
19+
env:
20+
DEFAULT_NODE_VERSION: '20.13.0'
21+
HUSKY: '0'
22+
NEXT_TELEMETRY_DISABLED: '1'
23+
24+
jobs:
25+
main:
26+
name: 🚀 CI Pipeline
27+
runs-on: ubuntu-latest
28+
timeout-minutes: 15
29+
steps:
30+
- name: 📥 Checkout Repository
31+
uses: actions/checkout@v4
32+
with:
33+
fetch-depth: 0
34+
35+
- name: 🔨 Setup Node.js
36+
uses: actions/setup-node@v3
37+
timeout-minutes: 1
38+
with:
39+
node-version: ${{ env.DEFAULT_NODE_VERSION }}
40+
41+
- name: 📦 Install Dependencies
42+
uses: ./.github/actions/pnpm-install
43+
timeout-minutes: 5
44+
45+
- name: 🔄 Set Nx Base/Head
46+
uses: nrwl/nx-set-shas@v4
47+
48+
- name: 🔑 Create Environment File
49+
timeout-minutes: 1
50+
run: |
51+
echo '${{ secrets.DEV_REACT_APP_CONFIG }}' > config.json
52+
echo '${{ secrets.DEV_ONE_APP_CONFIG }}' | jq -r 'to_entries | .[] | "\(.key)=\(.value)"' > services/one-app/.env
53+
54+
- name: 🔍 Run Type Check
55+
run: pnpm nx-cloud record -- nx affected -t type-check
56+
57+
- name: 📦 Run Build
58+
run: pnpm nx-cloud record -- nx affected -t build
59+
60+
- name: 🧪 Run Tests
61+
run: pnpm nx-cloud record -- nx-cloud record -- nx affected -t test
62+
63+
- name: 💅 Run Lint
64+
run: pnpm nx-cloud record -- nx-cloud record -- nx affected -t lint

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ COPY pnpm-workspace.yaml ./
1515
COPY .nx ./
1616

1717
RUN pnpm install
18+
RUN pnpm install sharp
1819

1920
ENV NEXT_TELEMETRY_DISABLED=1
2021

nx.json

Lines changed: 16 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,43 @@
11
{
22
"extends": "nx/presets/npm.json",
3-
"affected": {
4-
"defaultBase": "main"
5-
},
63
"workspaceLayout": {
74
"appsDir": "services",
85
"libsDir": "packages"
96
},
10-
"tasksRunnerOptions": {
11-
"default": {
12-
"runner": "nx/tasks-runners/default",
13-
"options": {
14-
"cacheableOperations": [
15-
"build",
16-
"test",
17-
"test:run",
18-
"test:coverage",
19-
"lint",
20-
"lint:fix",
21-
"type-check"
22-
]
23-
}
24-
}
25-
},
267
"targetDefaults": {
27-
"dev": {
28-
"cache": false,
29-
"persistent": true
30-
},
31-
"build": {
32-
"dependsOn": ["^build", "type-check"],
33-
"outputs": ["{projectRoot}/dist/**"]
34-
},
35-
"start": {
36-
"dependsOn": ["build"],
37-
"cache": false,
38-
"persistent": true
8+
"type-check": {
9+
"cache": true,
10+
"inputs": ["{projectRoot}/**/*.{ts,tsx}", "{projectRoot}/tsconfig.json"]
3911
},
4012
"lint": {
41-
"dependsOn": ["^lint", "type-check"],
42-
"inputs": ["{projectRoot}/**/*.{js,ts,tsx}"]
43-
},
44-
"lint:fix": {
45-
"dependsOn": ["^lint:fix"],
13+
"cache": true,
4614
"inputs": ["{projectRoot}/**/*.{js,ts,tsx}"]
4715
},
48-
"type-check": {
49-
"cache": false,
50-
"inputs": ["{projectRoot}/**/*.{ts,tsx}", "{projectRoot}/tsconfig.json"]
51-
},
52-
"test": {
16+
"build": {
17+
"cache": true,
5318
"dependsOn": ["^build"],
54-
"cache": false,
55-
"inputs": ["{projectRoot}/src/**/*.{js,ts,tsx}", "{projectRoot}/test/**/*.{js,ts,tsx}"]
19+
"outputs": ["{projectRoot}/dist/**"]
5620
},
57-
"test:run": {
58-
"dependsOn": ["^build"],
21+
"test": {
5922
"cache": true,
6023
"inputs": ["{projectRoot}/src/**/*.{js,ts,tsx}", "{projectRoot}/test/**/*.{js,ts,tsx}"]
6124
},
62-
"test:coverage": {
63-
"dependsOn": ["^build"],
64-
"cache": true,
65-
"inputs": ["{projectRoot}/src/**/*.{js,ts,tsx}", "{projectRoot}/test/**/*.{js,ts,tsx}"],
66-
"outputs": ["{projectRoot}/coverage/**"]
67-
},
68-
"test:playwright": {
69-
"dependsOn": ["^build"],
70-
"cache": false,
71-
"inputs": ["{projectRoot}/src/**/*.{js,ts,tsx}", "{projectRoot}/e2e/**/*.{js,ts,tsx}"]
72-
},
73-
"test:playwright:ui": {
74-
"dependsOn": ["^build"],
25+
"start": {
7526
"cache": false,
76-
"inputs": ["{projectRoot}/src/**/*.{js,ts,tsx}", "{projectRoot}/e2e/**/*.{js,ts,tsx}"]
27+
"persistent": true,
28+
"dependsOn": ["^build"]
7729
},
78-
"test:all": {
79-
"dependsOn": ["^build", "test:run", "test:playwright"],
80-
"cache": false
30+
"lint:fix": {
31+
"cache": true
8132
}
8233
},
34+
"defaultBase": "main",
8335
"namedInputs": {
8436
"default": ["{projectRoot}/**/*", "!{projectRoot}/**/*.md"],
8537
"production": ["default", "!{projectRoot}/**/*.spec.ts"]
8638
},
8739
"implicitDependencies": {
8840
"**/.env.*local": "*"
89-
}
41+
},
42+
"nxCloudId": "679e791071fd2cb4bf200e60"
9043
}

package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,7 @@
1919
"all:build": "nx run-many --target=build --all",
2020
"all:lint": "nx run-many --target=lint --all",
2121
"all:lint:fix": "nx run-many --target=lint:fix --all",
22-
"all:test": "nx run-many --target=test --all",
23-
"all:test:unit": "nx run-many --target=test:run --all",
24-
"all:test:coverage": "nx run-many --target=test:coverage --all",
25-
"all:test:e2e": "nx run-many --target=test:playwright --all",
26-
"all:test:e2e:ui": "nx run-many --target=test:playwright:ui --all"
22+
"all:test": "nx run-many --target=test --all"
2723
},
2824
"devDependencies": {
2925
"@trivago/prettier-plugin-sort-imports": "^4.3.0",

0 commit comments

Comments
 (0)