Skip to content

Commit b5c151e

Browse files
feat: update workflow
1 parent 696a5ae commit b5c151e

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,30 @@ jobs:
1717
with:
1818
fetch-depth: 3
1919
- uses: technote-space/get-diff-action@v1
20-
id: git-diff
2120
with:
2221
PREFIX_FILTER: |
2322
src/
2423
__tests__/
2524
SUFFIX_FILTER: .ts
25+
FILES: .eslintrc
2626
- name: Get Yarn Cache Directory
2727
id: yarn-cache
2828
run: echo "::set-output name=dir::$(yarn cache dir)"
29-
if: steps.git-diff.outputs.diff
29+
if: env.GIT_DIFF
3030
- name: Cache node dependencies
3131
uses: actions/cache@v1
3232
with:
3333
path: ${{ steps.yarn-cache.outputs.dir }}
3434
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
3535
restore-keys: |
3636
${{ runner.os }}-yarn-
37-
if: steps.git-diff.outputs.diff
37+
if: env.GIT_DIFF
3838
- name: Install Package dependencies
3939
run: yarn install
40-
if: steps.git-diff.outputs.diff
40+
if: env.GIT_DIFF
4141
- name: Check code style
42-
run: yarn eslint ${{ steps.git-diff.outputs.diff }}
43-
if: steps.git-diff.outputs.diff
42+
run: yarn eslint ${{ env.GIT_DIFF }}
43+
if: env.GIT_DIFF
4444
- uses: 8398a7/action-slack@v1
4545
with:
4646
type: failure
@@ -61,41 +61,43 @@ jobs:
6161
with:
6262
fetch-depth: 3
6363
- uses: technote-space/get-diff-action@v1
64-
id: git-diff
6564
with:
6665
PREFIX_FILTER: |
6766
src/
6867
__tests__/
6968
SUFFIX_FILTER: .ts
69+
FILES: |
70+
yarn.lock
71+
jest.config.js
7072
- name: Setup node
7173
uses: actions/setup-node@v1
7274
with:
7375
node-version: ${{ matrix.node }}
74-
if: steps.git-diff.outputs.diff || github.event_name == 'push'
76+
if: env.GIT_DIFF || github.event_name == 'push'
7577
- name: Get Yarn Cache Directory
7678
id: yarn-cache
7779
run: echo "::set-output name=dir::$(yarn cache dir)"
78-
if: steps.git-diff.outputs.diff || github.event_name == 'push'
80+
if: env.GIT_DIFF || github.event_name == 'push'
7981
- name: Cache node dependencies
8082
uses: actions/cache@v1
8183
with:
8284
path: ${{ steps.yarn-cache.outputs.dir }}
8385
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
8486
restore-keys: |
8587
${{ runner.os }}-yarn-
86-
if: steps.git-diff.outputs.diff || github.event_name == 'push'
88+
if: env.GIT_DIFF || github.event_name == 'push'
8789
- name: Install Package dependencies
8890
run: yarn install
89-
if: steps.git-diff.outputs.diff || github.event_name == 'push'
91+
if: env.GIT_DIFF || github.event_name == 'push'
9092
- name: Run tests
9193
run: yarn cover
92-
if: steps.git-diff.outputs.diff || github.event_name == 'push'
94+
if: env.GIT_DIFF || github.event_name == 'push'
9395
- name: Codecov
9496
run: curl -s https://codecov.io/bash | bash -s -- -t $CODECOV_TOKEN -f $COVERAGE_FILE
9597
env:
9698
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
9799
COVERAGE_FILE: ./coverage/lcov.info
98-
if: matrix.node == '12' && (steps.git-diff.outputs.diff || github.event_name == 'push')
100+
if: matrix.node == '12' && (env.GIT_DIFF || github.event_name == 'push')
99101
- uses: 8398a7/action-slack@v1
100102
with:
101103
type: failure

0 commit comments

Comments
 (0)