Skip to content

Commit

Permalink
ci: 新增 test.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
CaoMeiYouRen committed Mar 5, 2021
1 parent d41f877 commit e3e2e76
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
- master
jobs:
release:
# if: contains(github.event.commit_comment.body,'feat') || contains(github.event.commit_comment.body,'fix')
name: Release
runs-on: ubuntu-latest
steps:
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Test
on: [push, pull_request]
jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
node: ["12", "14"]
steps:
- uses: actions/checkout@v2
- name: Setup Node.js@${{ matrix.node }} environment
uses: actions/[email protected]
with:
node-version: ${{ matrix.node }}
- name: Cache multiple paths
uses: actions/cache@v2
with:
path: |
~/.npm
~/cache
!~/cache/exclude
**/node_modules
key: npm-${{ runner.os }}-${{ hashFiles('package.json') }}
- run: yarn
- run: npm run lint
- run: npm run build
- run: npm run start
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
},
"lint-staged": {
"*.{js,ts}": [
"cross-env NODE_ENV=production eslint --fix",
"npm run lint",
"git add"
]
}
Expand Down

0 comments on commit e3e2e76

Please sign in to comment.