|
1 | | -on: [push, pull_request] |
2 | | - |
3 | | -name: CI |
4 | | - |
5 | | -jobs: |
6 | | - lint: |
7 | | - name: Lint |
8 | | - runs-on: ubuntu-latest |
9 | | - steps: |
10 | | - - uses: actions/checkout@v2 |
11 | | - - uses: actions/setup-node@v1 |
12 | | - with: |
13 | | - node-version: '14' |
14 | | - # see https://github.com/actions/cache/blob/main/examples.md#node---npm |
15 | | - - name: Get npm cache directory |
16 | | - id: npm-cache-dir |
17 | | - run: | |
18 | | - echo "::set-output name=dir::$(npm config get cache)" |
19 | | - - uses: actions/cache@v2 |
20 | | - id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true' |
21 | | - with: |
22 | | - path: ${{ steps.npm-cache-dir.outputs.dir }} |
23 | | - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} |
24 | | - restore-keys: | |
25 | | - ${{ runner.os }}-node- |
26 | | -
|
27 | | - - run: npm update -g npm@latest |
28 | | - - run: npm install |
29 | | - - run: npm run ci-eslint |
30 | | - |
31 | | - format: |
32 | | - name: Format |
33 | | - runs-on: ubuntu-latest |
34 | | - steps: |
35 | | - - uses: actions/checkout@v2 |
36 | | - - uses: actions/setup-node@v1 |
37 | | - with: |
38 | | - node-version: '14' |
39 | | - |
40 | | - # see https://github.com/actions/cache/blob/main/examples.md#node---npm |
41 | | - - name: Get npm cache directory |
42 | | - id: npm-cache-dir |
43 | | - run: | |
44 | | - echo "::set-output name=dir::$(npm config get cache)" |
45 | | - - uses: actions/cache@v2 |
46 | | - id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true' |
47 | | - with: |
48 | | - path: ${{ steps.npm-cache-dir.outputs.dir }} |
49 | | - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} |
50 | | - restore-keys: | |
51 | | - ${{ runner.os }}-node- |
52 | | -
|
53 | | - - run: npm update -g npm@latest |
54 | | - - run: npm install |
55 | | - - run: npm run ci-format |
| 1 | +on: [push, pull_request] |
| 2 | + |
| 3 | +name: CI |
| 4 | + |
| 5 | +jobs: |
| 6 | + lint: |
| 7 | + name: Lint |
| 8 | + runs-on: ubuntu-latest |
| 9 | + steps: |
| 10 | + - uses: actions/checkout@v2 |
| 11 | + - uses: actions/setup-node@v1 |
| 12 | + with: |
| 13 | + node-version: "14" |
| 14 | + # see https://github.com/actions/cache/blob/main/examples.md#node---npm |
| 15 | + - name: Get npm cache directory |
| 16 | + id: npm-cache-dir |
| 17 | + run: | |
| 18 | + echo "::set-output name=dir::$(npm config get cache)" |
| 19 | + - uses: actions/cache@v2 |
| 20 | + id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true' |
| 21 | + with: |
| 22 | + path: ${{ steps.npm-cache-dir.outputs.dir }} |
| 23 | + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} |
| 24 | + restore-keys: | |
| 25 | + ${{ runner.os }}-node- |
| 26 | +
|
| 27 | + - run: npm update -g npm@latest |
| 28 | + - run: npm install |
| 29 | + - run: npm run ci-eslint |
| 30 | + |
| 31 | + format: |
| 32 | + name: Format |
| 33 | + runs-on: ubuntu-latest |
| 34 | + steps: |
| 35 | + - uses: actions/checkout@v2 |
| 36 | + - uses: actions/setup-node@v1 |
| 37 | + with: |
| 38 | + node-version: "14" |
| 39 | + |
| 40 | + # see https://github.com/actions/cache/blob/main/examples.md#node---npm |
| 41 | + - name: Get npm cache directory |
| 42 | + id: npm-cache-dir |
| 43 | + run: | |
| 44 | + echo "::set-output name=dir::$(npm config get cache)" |
| 45 | + - uses: actions/cache@v2 |
| 46 | + id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true' |
| 47 | + with: |
| 48 | + path: ${{ steps.npm-cache-dir.outputs.dir }} |
| 49 | + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} |
| 50 | + restore-keys: | |
| 51 | + ${{ runner.os }}-node- |
| 52 | +
|
| 53 | + - run: npm update -g npm@latest |
| 54 | + - run: npm install |
| 55 | + - run: npm run ci-format |
0 commit comments