|
6 | 6 | push: |
7 | 7 | branches: ["main"] |
8 | 8 |
|
9 | | -jobs: |
10 | | - lint: |
11 | | - runs-on: ubuntu-latest |
12 | | - name: Lint |
13 | | - steps: |
14 | | - - uses: actions/checkout@v4 |
15 | | - with: |
16 | | - fetch-depth: 0 |
17 | | - |
18 | | - - name: Install Node.js |
19 | | - uses: actions/setup-node@v4 |
20 | | - with: |
21 | | - node-version: 20 |
| 9 | +concurrency: |
| 10 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 11 | + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} |
22 | 12 |
|
23 | | - - uses: pnpm/action-setup@v3.0.0 |
24 | | - name: Install pnpm |
25 | | - id: pnpm-install |
26 | | - with: |
27 | | - version: 8.6.1 |
28 | | - run_install: false |
29 | | - |
30 | | - - name: Get pnpm store directory |
31 | | - id: pnpm-cache |
32 | | - run: | |
33 | | - echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT |
34 | | - - uses: actions/cache@v4 |
35 | | - name: Setup pnpm cache |
36 | | - with: |
37 | | - path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} |
38 | | - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} |
39 | | - restore-keys: | |
40 | | - ${{ runner.os }}-pnpm-store- |
41 | | - - name: Install dependencies |
42 | | - run: pnpm install |
43 | | - |
44 | | - - run: cp .env.example .env.local |
45 | | - |
46 | | - - run: pnpm lint |
| 13 | +env: |
| 14 | + FORCE_COLOR: 3 |
47 | 15 |
|
| 16 | +jobs: |
48 | 17 | format: |
49 | 18 | runs-on: ubuntu-latest |
50 | | - name: Format |
51 | 19 | steps: |
52 | | - - uses: actions/checkout@v4 |
| 20 | + - name: Checkout repo |
| 21 | + uses: actions/checkout@v4 |
| 22 | + - name: Setup pnpm |
| 23 | + uses: pnpm/action-setup@v4 |
53 | 24 | with: |
54 | | - fetch-depth: 0 |
| 25 | + version: 9.15.4 |
| 26 | + - uses: ./.github/setup |
55 | 27 |
|
56 | | - - name: Install Node.js |
57 | | - uses: actions/setup-node@v4 |
58 | | - with: |
59 | | - node-version: 20 |
| 28 | + - name: Check formatting |
| 29 | + run: pnpm lint:fix |
60 | 30 |
|
61 | | - - uses: pnpm/action-setup@v3.0.0 |
62 | | - name: Install pnpm |
63 | | - id: pnpm-install |
64 | | - with: |
65 | | - version: 8.6.1 |
66 | | - run_install: false |
67 | | - |
68 | | - - name: Get pnpm store directory |
69 | | - id: pnpm-cache |
70 | | - run: | |
71 | | - echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT |
72 | | -
|
73 | | - - uses: actions/cache@v4 |
74 | | - name: Setup pnpm cache |
| 31 | + lint: |
| 32 | + runs-on: ubuntu-latest |
| 33 | + name: Lint |
| 34 | + steps: |
| 35 | + - name: Checkout repo |
| 36 | + uses: actions/checkout@v4 |
| 37 | + - name: Setup pnpm |
| 38 | + uses: pnpm/action-setup@v4 |
75 | 39 | with: |
76 | | - path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} |
77 | | - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} |
78 | | - restore-keys: | |
79 | | - ${{ runner.os }}-pnpm-store- |
80 | | -
|
81 | | - - name: Install dependencies |
82 | | - run: pnpm install |
83 | | - |
84 | | - - run: cp .env.example .env.local |
| 40 | + version: 9.15.4 |
| 41 | + - uses: ./.github/setup |
85 | 42 |
|
86 | | - - run: pnpm format:check |
| 43 | + - run: pnpm lint |
87 | 44 |
|
88 | | - tsc: |
| 45 | + typecheck: |
89 | 46 | runs-on: ubuntu-latest |
90 | 47 | name: Typecheck |
91 | 48 | steps: |
92 | | - - uses: actions/checkout@v4 |
93 | | - with: |
94 | | - fetch-depth: 0 |
95 | | - |
96 | | - - name: Install Node.js |
97 | | - uses: actions/setup-node@v4 |
98 | | - with: |
99 | | - node-version: 20 |
100 | | - |
101 | | - - uses: pnpm/action-setup@v3.0.0 |
102 | | - name: Install pnpm |
103 | | - id: pnpm-install |
104 | | - with: |
105 | | - version: 8.6.1 |
106 | | - run_install: false |
107 | | - |
108 | | - - name: Get pnpm store directory |
109 | | - id: pnpm-cache |
110 | | - run: | |
111 | | - echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT |
112 | | - - uses: actions/cache@v4 |
113 | | - name: Setup pnpm cache |
| 49 | + - name: Checkout repo |
| 50 | + uses: actions/checkout@v4 |
| 51 | + - name: Setup pnpm |
| 52 | + uses: pnpm/action-setup@v4 |
114 | 53 | with: |
115 | | - path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} |
116 | | - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} |
117 | | - restore-keys: | |
118 | | - ${{ runner.os }}-pnpm-store- |
119 | | - - name: Install dependencies |
120 | | - run: pnpm install |
121 | | - |
122 | | - - run: cp .env.example .env.local |
| 54 | + version: 9.15.4 |
| 55 | + - uses: ./.github/setup |
123 | 56 |
|
124 | 57 | - run: pnpm typecheck |
0 commit comments