|
1 | 1 | name: CI |
2 | 2 |
|
3 | 3 | on: |
4 | | - push: |
5 | | - branches: [feat_*, dev] |
6 | | - pull_request: |
7 | | - branches: [master, dev] |
| 4 | + push: |
| 5 | + branches: "master" |
| 6 | + pull_request: |
| 7 | + branches: "*" |
8 | 8 |
|
9 | 9 | jobs: |
10 | | - setup: |
11 | | - runs-on: ubuntu-latest |
12 | | - steps: |
13 | | - - name: Checkout code |
14 | | - uses: actions/checkout@v2 |
15 | | - |
16 | | - - name: 'Set pnpm' |
17 | | - |
18 | | - with: |
19 | | - version: 6.32.20 |
20 | | - |
21 | | - - name: Setup node |
22 | | - uses: actions/setup-node@v3 |
23 | | - with: |
24 | | - node-version: 14.x |
25 | | - cache: pnpm |
26 | | - |
27 | | - - name: Cache pnpm-lock.yaml |
28 | | - uses: actions/cache@v2 |
29 | | - with: |
30 | | - path: package-temp-dir |
31 | | - key: lock-${{ github.sha }} |
32 | | - |
33 | | - - name: Hack for single file |
34 | | - run: | |
35 | | - if [ ! -d "package-temp-dir" ]; then |
36 | | - mkdir package-temp-dir |
37 | | - fi |
38 | | - cp pnpm-lock.yaml package-temp-dir |
39 | | - - name: Cache node_modules |
40 | | - id: node_modules_cache_id |
41 | | - uses: actions/cache@v2 |
42 | | - with: |
43 | | - path: node_modules |
44 | | - key: node_modules-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/package-temp-dir/pnpm-lock.yaml') }} |
45 | | - |
46 | | - - name: Install dependencies |
47 | | - if: steps.node_modules_cache_id.outputs.cache-hit != 'true' |
48 | | - run: pnpm install |
49 | | - |
50 | | - lint: |
51 | | - needs: [setup] |
52 | | - runs-on: ubuntu-latest |
53 | | - steps: |
54 | | - - uses: actions/checkout@v2 |
55 | | - |
56 | | - - name: 'Set pnpm' |
57 | | - |
58 | | - with: |
59 | | - version: 6.32.20 |
60 | | - |
61 | | - - name: Restore cache from pnpm-lock.yaml |
62 | | - uses: actions/cache@v2 |
63 | | - with: |
64 | | - path: package-temp-dir |
65 | | - key: lock-${{ github.sha }} |
66 | | - |
67 | | - - name: Restore cache from node_modules |
68 | | - uses: actions/cache@v2 |
69 | | - with: |
70 | | - path: node_modules |
71 | | - key: node_modules-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/package-temp-dir/pnpm-lock.yaml') }} |
72 | | - |
73 | | - - name: Run lint |
74 | | - run: pnpm run lint |
75 | | - |
76 | | - build: |
77 | | - runs-on: ubuntu-latest |
78 | | - needs: [setup, lint] |
79 | | - steps: |
80 | | - - uses: actions/checkout@v2 |
81 | | - |
82 | | - - name: 'Set pnpm' |
83 | | - |
84 | | - with: |
85 | | - version: 6.32.20 |
86 | | - |
87 | | - - name: Restore cache from pnpm-lock.yaml |
88 | | - uses: actions/cache@v2 |
89 | | - with: |
90 | | - path: package-temp-dir |
91 | | - key: lock-${{ github.sha }} |
92 | | - |
93 | | - - name: Restore cache from node_modules |
94 | | - uses: actions/cache@v2 |
95 | | - with: |
96 | | - path: node_modules |
97 | | - key: node_modules-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/package-temp-dir/pnpm-lock.yaml') }} |
98 | | - |
99 | | - - name: Build test |
100 | | - run: pnpm run build |
| 10 | + setup: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + - name: Checkout code |
| 14 | + uses: actions/checkout@v2 |
| 15 | + |
| 16 | + - name: "Set pnpm" |
| 17 | + |
| 18 | + with: |
| 19 | + version: 6.32.20 |
| 20 | + |
| 21 | + - name: Setup node |
| 22 | + uses: actions/setup-node@v3 |
| 23 | + with: |
| 24 | + node-version: 14.x |
| 25 | + cache: pnpm |
| 26 | + |
| 27 | + - name: Install dependencies |
| 28 | + run: pnpm install |
| 29 | + |
| 30 | + - name: Run lint |
| 31 | + run: pnpm run lint |
| 32 | + |
| 33 | + - name: Build test |
| 34 | + run: pnpm run build |
0 commit comments