chore: split up browser and node tests

Makes sure that only node tests are ran on multiple versions, rather than also running linting and browser tests on multiple node versions
This commit is contained in:
Joren Broekema 2020-07-28 17:42:28 +02:00
parent 5cd2c3491c
commit c8a5d60f62
2 changed files with 71 additions and 9 deletions

View file

@ -3,13 +3,61 @@ name: Verify changes
on: pull_request
jobs:
install:
name: Install dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Install dependencies
run: yarn --frozen-lockfile
- uses: actions/upload-artifact@v2
with:
name: Node Modules
path: node_modules
verify:
name: Verify changes
needs: install
runs-on: ubuntu-latest
steps:
- name: Download math result for job 1
uses: actions/download-artifact@v2
with:
name: Node Modules
- uses: actions/checkout@v2
- name: Setup Node 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Lint
run: yarn lint
- name: Bundlesize
run: yarn bundlesize
browser-tests:
name: Browser tests
needs: install
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x, 14.x]
steps:
- name: Download math result for job 1
uses: actions/download-artifact@v2
with:
name: Node Modules
- uses: actions/checkout@v2
- name: Setup Node ${{ matrix.node-version }}
@ -17,14 +65,28 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn --frozen-lockfile
- name: Test
run: yarn test:browser
- name: Lint
run: yarn lint
node-tests:
name: Node tests
needs: install
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x, 14.x]
steps:
- name: Download math result for job 1
uses: actions/download-artifact@v2
with:
name: Node Modules
- uses: actions/checkout@v2
- name: Setup Node ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Test
run: yarn test
- name: Bundlesize
run: yarn bundlesize
run: yarn test:node

View file

@ -20,7 +20,7 @@
"lint:prettier": "prettier \"**/*.js\" --list-different || (echo '↑↑ these files are not prettier formatted ↑↑' && exit 1)",
"lint:types": "tsc",
"lint:versions": "node ./scripts/lint-versions.js",
"release": "npm run build:types && npm run build:docs && changeset release",
"release": "npm run build:types && npm run build:docs && changeset publish",
"start": "npm run storybook",
"storybook": "start-storybook -p 9001",
"storybook:build": "build-storybook",