Skip to content

Commit

Permalink
chore: 测试覆盖 Linux, MacOS, Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
fjc0k committed Mar 12, 2022
1 parent b4c20a8 commit fd92bdb
Showing 1 changed file with 25 additions and 11 deletions.
36 changes: 25 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,33 @@ on:

jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node: ['14']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
id: cache
- name: Checkout
uses: actions/checkout@v2
- name: Setup node.js
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Cache
uses: actions/cache@v2
with:
path: node_modules
key: ${{ hashFiles('yarn.lock') }}
- if: ${{ steps.cache.outputs.cache-hit != 'true' }}
run: npx yarn
- run: |
npm test
npx codecov
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}
- name: Install deps
run: |
# 解决 Windows 下的超时问题
# https://github.com/yarnpkg/yarn/issues/8242
yarn config set network-timeout 300000
yarn
- name: Test
run: yarn test
- name: Codecov
if: matrix.os == 'ubuntu-latest'
run: yarn codecov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

0 comments on commit fd92bdb

Please sign in to comment.