chore(ci): unit tests do not depend on fixtures

This commit is contained in:
Clark Du 2020-01-20 23:30:48 +00:00 committed by Pooya Parsa
parent 0edf819c15
commit 042c0ae692
1 changed files with 34 additions and 40 deletions

View File

@ -98,6 +98,40 @@ jobs:
run: yarn run audit run: yarn run audit
needs: setup needs: setup
test-unit:
runs-on: ${{ matrix.os }}
strategy:
matrix:
# os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest]
node: [10, 12]
steps:
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: checkout
uses: actions/checkout@master
- name: restore workspace cache
uses: actions/cache@v1
with:
path: ${{ github.workspace }}
key: ${{ matrix.os }}-node-v${{ matrix.node }}-nuxt-${{ github.sha }}
- name: test unit
run: yarn test:unit --coverage
- name: codecov
uses: codecov/codecov-action@v1
if: matrix.os == 'ubuntu-latest' && matrix.node == '10'
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
needs: setup
build: build:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
@ -196,46 +230,6 @@ jobs:
run: yarn test:dev -w=2 run: yarn test:dev -w=2
needs: build needs: build
test-unit:
runs-on: ${{ matrix.os }}
strategy:
matrix:
# os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest]
node: [10, 12]
steps:
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: checkout
uses: actions/checkout@master
- name: restore workspace cache
uses: actions/cache@v1
with:
path: ${{ github.workspace }}
key: ${{ matrix.os }}-node-v${{ matrix.node }}-nuxt-${{ github.sha }}
- name: restore fixtures
uses: actions/cache@v1
with:
path: test/fixtures
key: ${{ matrix.os }}-node-v${{ matrix.node }}-fixtures-${{ github.sha }}
- name: test unit
run: yarn test:unit --coverage
- name: codecov
uses: codecov/codecov-action@v1
if: matrix.os == 'ubuntu-latest' && matrix.node == '10'
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
needs: build
test-e2e: test-e2e:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}