|
5 | 5 | branches: ['*'] |
6 | 6 |
|
7 | 7 | jobs: |
8 | | - lint: |
| 8 | + code-check: |
9 | 9 | runs-on: ubuntu-latest |
10 | | - name: pnpm lint |
| 10 | + name: Code check |
11 | 11 | steps: |
| 12 | + # Checkout the repository |
12 | 13 | - uses: actions/checkout@v3 |
13 | 14 | with: |
14 | 15 | fetch-depth: 0 |
15 | 16 |
|
| 17 | + # Set up Node.js environment |
16 | 18 | - name: Install Node.js |
17 | 19 | uses: actions/setup-node@v3 |
18 | 20 | with: |
19 | | - node-version: 16 |
| 21 | + node-version: 18 # Specify the Node.js version |
20 | 22 |
|
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 |
24 | 26 | with: |
25 | | - version: 8.6.1 |
| 27 | + version: 9.0.4 |
26 | 28 | run_install: false |
27 | 29 |
|
| 30 | + # Get pnpm store directory |
28 | 31 | - name: Get pnpm store directory |
29 | 32 | 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 |
| 33 | + run: echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT |
56 | 34 |
|
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 |
68 | | -
|
69 | | - - uses: actions/cache@v3 |
70 | | - name: Setup pnpm cache |
| 35 | + # Cache pnpm store |
| 36 | + - name: Setup pnpm cache |
| 37 | + uses: actions/cache@v3 |
71 | 38 | with: |
72 | 39 | path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} |
73 | 40 | key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} |
74 | 41 | restore-keys: | |
75 | 42 | ${{ runner.os }}-pnpm-store- |
76 | 43 |
|
| 44 | + # Install dependencies |
77 | 45 | - name: Install dependencies |
78 | | - run: pnpm install |
| 46 | + run: pnpm install --no-frozen-lockfile |
79 | 47 |
|
80 | | - - run: pnpm format:check |
| 48 | + # Run linter |
| 49 | + - name: Run linter |
| 50 | + run: pnpm lint |
81 | 51 |
|
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 |
| 52 | + # Check code formatting |
| 53 | + - name: Check code formatting |
| 54 | + run: pnpm format:check |
89 | 55 |
|
90 | | - - name: Install Node.js |
91 | | - uses: actions/setup-node@v3 |
92 | | - with: |
93 | | - node-version: 16 |
94 | | - |
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 |
101 | | - |
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 |
| 56 | + # Check types |
| 57 | + - name: Check types |
| 58 | + run: pnpm check-types |
115 | 59 |
|
116 | | - - run: pnpm check-types |
| 60 | + # Test apps |
| 61 | + - name: Test apps |
| 62 | + run: pnpm test |
0 commit comments