Skip to content

Commit 134e274

Browse files
author
hoangdevnull
committed
fix: cicd
1 parent 0f2a4ce commit 134e274

1 file changed

Lines changed: 25 additions & 83 deletions

File tree

.github/workflows/code-check.yml

Lines changed: 25 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -5,112 +5,54 @@ on:
55
branches: ['*']
66

77
jobs:
8-
lint:
8+
code-check:
99
runs-on: ubuntu-latest
10-
name: pnpm lint
10+
name: Code check
1111
steps:
12+
# Checkout the repository
1213
- uses: actions/checkout@v3
1314
with:
1415
fetch-depth: 0
1516

17+
# Set up Node.js environment
1618
- name: Install Node.js
1719
uses: actions/setup-node@v3
1820
with:
19-
node-version: 16
21+
node-version: 18 # Specify the Node.js version
2022

21-
- uses: pnpm/action-setup@v2.2.4
22-
name: Install pnpm
23-
id: pnpm-install
23+
# Install pnpm
24+
- name: Install pnpm
25+
uses: pnpm/action-setup@v3
2426
with:
25-
version: 8.6.1
27+
version: 9.0.4
2628
run_install: false
2729

30+
# Get pnpm store directory
2831
- name: Get pnpm store directory
2932
id: pnpm-cache
30-
run: |
31-
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
32-
- uses: actions/cache@v3
33-
name: Setup pnpm cache
34-
with:
35-
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
36-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
37-
restore-keys: |
38-
${{ runner.os }}-pnpm-store-
39-
- name: Install dependencies
40-
run: pnpm install
41-
42-
- run: pnpm lint
43-
44-
format:
45-
runs-on: ubuntu-latest
46-
name: pnpm format:check
47-
steps:
48-
- uses: actions/checkout@v3
49-
with:
50-
fetch-depth: 0
51-
52-
- name: Install Node.js
53-
uses: actions/setup-node@v3
54-
with:
55-
node-version: 16
56-
57-
- uses: pnpm/action-setup@v2.2.4
58-
name: Install pnpm
59-
id: pnpm-install
60-
with:
61-
version: 8.6.1
62-
run_install: false
63-
64-
- name: Get pnpm store directory
65-
id: pnpm-cache
66-
run: |
67-
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
33+
run: echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
6834

69-
- uses: actions/cache@v3
70-
name: Setup pnpm cache
35+
# Cache pnpm store
36+
- name: Setup pnpm cache
37+
uses: actions/cache@v3
7138
with:
7239
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
7340
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
7441
restore-keys: |
7542
${{ runner.os }}-pnpm-store-
7643
44+
# Install dependencies
7745
- name: Install dependencies
78-
run: pnpm install
79-
80-
- run: pnpm format:check
81-
82-
tsc:
83-
runs-on: ubuntu-latest
84-
name: pnpm check-types
85-
steps:
86-
- uses: actions/checkout@v3
87-
with:
88-
fetch-depth: 0
89-
90-
- name: Install Node.js
91-
uses: actions/setup-node@v3
92-
with:
93-
node-version: 16
46+
run: pnpm install --no-frozen-lockfile
9447

95-
- uses: pnpm/action-setup@v2.2.4
96-
name: Install pnpm
97-
id: pnpm-install
98-
with:
99-
version: 8.6.1
100-
run_install: false
48+
# Run linter
49+
- name: Run linter
50+
run: pnpm lint
10151

102-
- name: Get pnpm store directory
103-
id: pnpm-cache
104-
run: |
105-
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
106-
- uses: actions/cache@v3
107-
name: Setup pnpm cache
108-
with:
109-
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
110-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
111-
restore-keys: |
112-
${{ runner.os }}-pnpm-store-
113-
- name: Install dependencies
114-
run: pnpm install
52+
# Check code formatting
53+
- name: Check code formatting
54+
run: pnpm format:check
11555

116-
- run: pnpm check-types
56+
# Check types
57+
- name: Check types
58+
run: pnpm check-types

0 commit comments

Comments
 (0)