From 79be5006dbc8e1f7150d6a22eef03aa0381c641b Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Wed, 26 May 2021 07:19:22 +1200 Subject: [PATCH 1/3] ci: do typecheck in its own job --- .github/workflows/nodejs.yml | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index f7a806e31..efd7026cc 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -40,6 +40,28 @@ jobs: YARN_ENABLE_SCRIPTS: false run: yarn --immutable + typecheck: + needs: prepare-yarn-cache + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Get yarn cache + id: yarn-cache + run: echo "::set-output name=dir::$(yarn config get cacheFolder)" + - uses: actions/cache@v2 + with: + path: ${{ steps.yarn-cache.outputs.dir }} + key: yarn2-${{ hashFiles('yarn.lock') }} + restore-keys: | + yarn2- + - uses: actions/setup-node@v2.1.5 + with: + node-version: 14.x + - name: install + run: yarn + - name: run typecheck + run: yarn typecheck + test-node: name: # prettier-ignore @@ -75,8 +97,6 @@ jobs: yarn add --dev eslint@${{matrix.eslint-version }} - name: run prettier run: yarn prettier:check - - name: run typecheck - run: yarn typecheck - name: run tests # only collect coverage on eslint versions that support the suggestions api run: yarn test --coverage ${{ matrix.eslint-version >= 6 }} @@ -111,8 +131,6 @@ jobs: run: yarn - name: run prettier run: yarn prettier:check - - name: run typecheck - run: yarn typecheck - name: run tests run: yarn test --coverage env: @@ -153,7 +171,7 @@ jobs: # prettier-ignore ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' }} name: Release new version - needs: [test-node, test-os] + needs: [typecheck, test-node, test-os] runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 From 714440e206899da103a3f1ff9bf494208d49a4cf Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Wed, 26 May 2021 07:20:29 +1200 Subject: [PATCH 2/3] ci: do prettier check in its own job --- .github/workflows/nodejs.yml | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index efd7026cc..c92a96cd3 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -40,6 +40,28 @@ jobs: YARN_ENABLE_SCRIPTS: false run: yarn --immutable + prettier: + needs: prepare-yarn-cache + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Get yarn cache + id: yarn-cache + run: echo "::set-output name=dir::$(yarn config get cacheFolder)" + - uses: actions/cache@v2 + with: + path: ${{ steps.yarn-cache.outputs.dir }} + key: yarn2-${{ hashFiles('yarn.lock') }} + restore-keys: | + yarn2- + - uses: actions/setup-node@v2.1.5 + with: + node-version: 14.x + - name: install + run: yarn + - name: run prettier + run: yarn prettier:check + typecheck: needs: prepare-yarn-cache runs-on: ubuntu-latest @@ -95,8 +117,6 @@ jobs: run: | yarn yarn add --dev eslint@${{matrix.eslint-version }} - - name: run prettier - run: yarn prettier:check - name: run tests # only collect coverage on eslint versions that support the suggestions api run: yarn test --coverage ${{ matrix.eslint-version >= 6 }} @@ -129,8 +149,6 @@ jobs: node-version: 14.x - name: install run: yarn - - name: run prettier - run: yarn prettier:check - name: run tests run: yarn test --coverage env: @@ -171,7 +189,7 @@ jobs: # prettier-ignore ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' }} name: Release new version - needs: [typecheck, test-node, test-os] + needs: [prettier, typecheck, test-node, test-os] runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 From 1c719eac8e41d1276af471e861ed189c1ead80fc Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Wed, 26 May 2021 07:21:20 +1200 Subject: [PATCH 3/3] ci: don't fetch everything on checkout on jobs that don't need it --- .github/workflows/nodejs.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index c92a96cd3..3e9c68cd4 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -98,8 +98,6 @@ jobs: steps: - uses: actions/checkout@v2 - with: - fetch-depth: 0 - name: Get yarn cache id: yarn-cache run: echo "::set-output name=dir::$(yarn config get cacheFolder)" @@ -160,8 +158,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - with: - fetch-depth: 0 - name: Get yarn cache id: yarn-cache run: echo "::set-output name=dir::$(yarn config get cacheFolder)"