Skip to content

Commit

Permalink
chore(ci): unit tests do not depend on fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
clarkdo committed Jan 20, 2020
1 parent 3f93d09 commit d6abd9f
Showing 1 changed file with 23 additions and 29 deletions.
52 changes: 23 additions & 29 deletions .github/workflows/test.yml
Expand Up @@ -98,7 +98,7 @@ jobs:
run: yarn run audit
needs: setup

build:
test-unit:
runs-on: ${{ matrix.os }}

strategy:
Expand All @@ -121,23 +121,25 @@ jobs:
path: ${{ github.workspace }}
key: ${{ matrix.os }}-node-v${{ matrix.node }}-nuxt-${{ github.sha }}

- name: build
run: yarn test:fixtures -i
- name: test unit
run: yarn test:unit --coverage

- name: cache fixtures
uses: actions/cache@v1
- name: codecov
uses: codecov/codecov-action@v1
if: matrix.os == 'ubuntu-latest' && matrix.node == '10'
with:
path: test/fixtures
key: ${{ matrix.os }}-node-v${{ matrix.node }}-fixtures-${{ github.sha }}
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
needs: setup

lint-app:
build:
runs-on: ${{ matrix.os }}

strategy:
matrix:
# os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest]
node: [12]
node: [10, 12]

steps:
- uses: actions/setup-node@v1
Expand All @@ -153,24 +155,23 @@ jobs:
path: ${{ github.workspace }}
key: ${{ matrix.os }}-node-v${{ matrix.node }}-nuxt-${{ github.sha }}

- name: restore fixtures
- name: build
run: yarn test:fixtures -i

- name: cache fixtures
uses: actions/cache@v1
with:
path: test/fixtures
key: ${{ matrix.os }}-node-v${{ matrix.node }}-fixtures-${{ github.sha }}
needs: setup

- name: lint app
run: yarn lint:app
needs: build

test-dev:
lint-app:
runs-on: ${{ matrix.os }}

strategy:
matrix:
# os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest]
node: [10, 12]
node: [12]

steps:
- uses: actions/setup-node@v1
Expand All @@ -192,11 +193,11 @@ jobs:
path: test/fixtures
key: ${{ matrix.os }}-node-v${{ matrix.node }}-fixtures-${{ github.sha }}

- name: test dev
run: yarn test:dev -w=2
- name: lint app
run: yarn lint:app
needs: build

test-unit:
test-dev:
runs-on: ${{ matrix.os }}

strategy:
Expand Down Expand Up @@ -225,15 +226,8 @@ jobs:
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
- name: test dev
run: yarn test:dev -w=2
needs: build

test-e2e:
Expand Down

0 comments on commit d6abd9f

Please sign in to comment.