Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

Commit

Permalink
use matrix to run tests in 30s (#55)
Browse files Browse the repository at this point in the history
* wip matrix

* different cache

* rerun with warm cache

* with no parallelism

* slice
  • Loading branch information
HugoDF committed Sep 1, 2020
1 parent c9d7a7c commit 86913ba
Showing 1 changed file with 36 additions and 7 deletions.
43 changes: 36 additions & 7 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,39 @@ name: test
on: [push]

jobs:
lint_build_test:
lint_unit:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
env:
CI: true
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Cache
uses: actions/cache@v2
with:
path: |
**/node_modules
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}
- name: yarn install
run: yarn
- name: lint
run: yarn lint
- name: unit test
run: yarn test:unit

test:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 12.x, 14.x]
node-version: [12.x]
command: ['yarn test:uvu && yarn test:jest', 'yarn test:tape && yarn test:ava']

env:
CI: true
Expand All @@ -20,10 +46,13 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- uses: c-hive/gha-yarn-cache@v1
- name: Cache
uses: actions/cache@v2
with:
path: |
**/node_modules
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}
- name: yarn install --frozen-lockfile
run: yarn
- name: lint
run: yarn lint
- name: test
run: yarn test
- name: test section
run: ${{ matrix.command }}

0 comments on commit 86913ba

Please sign in to comment.