From 86913baa848d615b16ba3b097b1df26609f4b868 Mon Sep 17 00:00:00 2001 From: Hugo Date: Tue, 1 Sep 2020 18:23:27 +0100 Subject: [PATCH] use matrix to run tests in 30s (#55) * wip matrix * different cache * rerun with warm cache * with no parallelism * slice --- .github/workflows/nodejs.yml | 43 ++++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 47feb3b..5dbc153 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -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 @@ -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 }}