Merge pull request #846 from spotify/rugvip/testem
github/workflows: run all tests on yarn.lock changes
This commit is contained in:
@@ -7,6 +7,7 @@ on:
|
||||
- 'packages/cli/**'
|
||||
- 'packages/core/**'
|
||||
- 'scripts/**'
|
||||
- 'yarn.lock'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
@@ -48,6 +48,11 @@ jobs:
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
|
||||
- name: check for yarn.lock changes
|
||||
id: yarn-lock
|
||||
run: git diff --quiet origin/master HEAD -- yarn.lock
|
||||
continue-on-error: true
|
||||
|
||||
- name: yarn install
|
||||
run: yarn install --frozen-lockfile
|
||||
|
||||
@@ -57,9 +62,14 @@ jobs:
|
||||
- name: build
|
||||
run: yarn build
|
||||
|
||||
- name: test
|
||||
- name: test changed packages
|
||||
if: ${{ steps.yarn-lock.outcome == 'success' }}
|
||||
run: yarn lerna -- run test --since origin/master -- --coverage
|
||||
|
||||
- name: test all packages
|
||||
if: ${{ steps.yarn-lock.outcome == 'failure' }}
|
||||
run: yarn lerna -- run test -- --coverage
|
||||
|
||||
- name: yarn bundle, if app was changed
|
||||
run: git diff --quiet origin/master HEAD -- yarn.lock packages/app packages/core || yarn bundle
|
||||
|
||||
|
||||
Reference in New Issue
Block a user