Skip to content

Commit 4b4508f

Browse files
committed
chore: adjust ci (#ci-adjust)
1 parent c884ebf commit 4b4508f

File tree

4 files changed

+74
-5040
lines changed

4 files changed

+74
-5040
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,17 @@ env:
2020
DEFAULT_NODE_VERSION: '20.13.0'
2121
HUSKY: '0'
2222
NEXT_TELEMETRY_DISABLED: '1'
23+
NX_BRANCH: ${{ github.event.number }}
24+
NX_RUN_GROUP: ${{ github.run_id }}
25+
# Nx Cloud
26+
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
2327

2428
jobs:
2529
main:
2630
name: 🚀 CI Pipeline
2731
runs-on: ubuntu-latest
2832
timeout-minutes: 15
33+
2934
steps:
3035
- name: 📥 Checkout Repository
3136
uses: actions/checkout@v4
@@ -38,6 +43,18 @@ jobs:
3843
with:
3944
node-version: ${{ env.DEFAULT_NODE_VERSION }}
4045

46+
# Improve caching for pnpm
47+
- name: 📦 Setup pnpm cache
48+
uses: actions/cache@v3
49+
with:
50+
path: |
51+
~/.pnpm-store
52+
node_modules
53+
*/*/node_modules
54+
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
55+
restore-keys: |
56+
${{ runner.os }}-pnpm-
57+
4158
- name: 📦 Install Dependencies
4259
uses: ./.github/actions/pnpm-install
4360
timeout-minutes: 5
@@ -51,14 +68,9 @@ jobs:
5168
echo '${{ secrets.DEV_REACT_APP_CONFIG }}' > config.json
5269
echo '${{ secrets.DEV_ONE_APP_CONFIG }}' | jq -r 'to_entries | .[] | "\(.key)=\(.value)"' > services/one-app/.env
5370
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
71+
# Run tasks in parallel using Nx's parallel execution
72+
- name: 🏃 Run CI Tasks
73+
run: |
74+
pnpm nx affected --parallel=3 \
75+
-t type-check,build,test,lint \
76+
--configuration=ci

nx.json

Lines changed: 51 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,37 +7,79 @@
77
"targetDefaults": {
88
"type-check": {
99
"cache": true,
10-
"inputs": ["{projectRoot}/**/*.{ts,tsx}", "{projectRoot}/tsconfig.json"]
10+
"inputs": [
11+
"{projectRoot}/**/*.{ts,tsx}",
12+
"{projectRoot}/tsconfig.json",
13+
"{workspaceRoot}/tsconfig.base.json"
14+
]
1115
},
1216
"lint": {
1317
"cache": true,
14-
"inputs": ["{projectRoot}/**/*.{js,ts,tsx}"]
18+
"inputs": [
19+
"{projectRoot}/**/*.{js,ts,tsx}",
20+
"{projectRoot}/.eslintrc.*",
21+
"{workspaceRoot}/.eslintrc.*"
22+
]
1523
},
1624
"build": {
1725
"cache": true,
1826
"dependsOn": ["^build"],
19-
"outputs": ["{projectRoot}/dist/**"]
27+
"inputs": ["production", "{workspaceRoot}/package.json"],
28+
"outputs": ["{projectRoot}/dist/**", "{projectRoot}/.next/**"]
2029
},
2130
"test": {
2231
"cache": true,
23-
"inputs": ["{projectRoot}/src/**/*.{js,ts,tsx}", "{projectRoot}/test/**/*.{js,ts,tsx}"]
32+
"inputs": [
33+
"{projectRoot}/src/**/*.{js,ts,tsx}",
34+
"{projectRoot}/test/**/*.{js,ts,tsx}",
35+
"{projectRoot}/jest.config.*",
36+
"{workspaceRoot}/jest.config.*"
37+
]
2438
},
2539
"start": {
2640
"cache": false,
2741
"persistent": true,
2842
"dependsOn": ["^build"]
2943
},
3044
"lint:fix": {
31-
"cache": true
45+
"cache": true,
46+
"inputs": [
47+
"{projectRoot}/**/*.{js,ts,tsx}",
48+
"{projectRoot}/.eslintrc.*",
49+
"{workspaceRoot}/.eslintrc.*"
50+
]
3251
}
3352
},
3453
"defaultBase": "main",
3554
"namedInputs": {
36-
"default": ["{projectRoot}/**/*", "!{projectRoot}/**/*.md"],
37-
"production": ["default", "!{projectRoot}/**/*.spec.ts"]
55+
"default": [
56+
"{projectRoot}/**/*",
57+
"!{projectRoot}/**/*.md",
58+
"!{projectRoot}/**/CHANGELOG.md",
59+
"!{projectRoot}/**/*.spec.ts",
60+
"!{projectRoot}/coverage/**"
61+
],
62+
"production": [
63+
"default",
64+
"!{projectRoot}/**/*.spec.ts",
65+
"!{projectRoot}/test/**/*",
66+
"!{projectRoot}/**/__tests__/**/*"
67+
]
3868
},
3969
"implicitDependencies": {
40-
"**/.env.*local": "*"
70+
"**/.env.*local": "*",
71+
"package.json": "*",
72+
"nx.json": "*"
4173
},
42-
"nxCloudId": "679e791071fd2cb4bf200e60"
74+
"nxCloudAccessToken": "${NX_CLOUD_ACCESS_TOKEN}",
75+
"parallel": 3,
76+
"tasksRunnerOptions": {
77+
"default": {
78+
"runner": "nx-cloud",
79+
"options": {
80+
"cacheableOperations": ["build", "test", "lint", "type-check"],
81+
"accessToken": "${NX_CLOUD_ACCESS_TOKEN}"
82+
}
83+
}
84+
}
4385
}

services/ahhachul.com/playwright-report/index.html

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

0 commit comments

Comments
 (0)