From 0cf8e61cf602c74bae704211270495a058036056 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Mon, 14 Jun 2021 15:50:00 -0600 Subject: [PATCH 1/3] Only run coverage once, and only if on a PR. --- .github/typescript-ci-patch.yaml | 5 ++++- .github/workflows/typescript-ci.yaml | 9 +-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/typescript-ci-patch.yaml b/.github/typescript-ci-patch.yaml index bcde680..183110e 100644 --- a/.github/typescript-ci-patch.yaml +++ b/.github/typescript-ci-patch.yaml @@ -44,7 +44,7 @@ # Only check coverage in one of the matrix job instances. - op: add path: /jobs/test/steps/7/if - value: ${{ contains(matrix.os, 'ubuntu') && matrix.node_version == '10' && matrix.rust_version == 'stable' }} + value: ${{ contains(matrix.os, 'ubuntu') && matrix.node_version == '10' && matrix.rust_version == 'stable' }} && github.base_ref != '' # Also run on musl. That means we need to run it in a Docker container. To do that, we copy the entire job and modify its # strategy/matrix. @@ -73,3 +73,6 @@ # We don't need to run setup-node inside of a node docker image. - op: remove path: /jobs/test-docker/steps/4 +# No need to check test coverage here, since we do it in the first matrix build. +- op: remove + path: /jobs/test-docker/steps/8 diff --git a/.github/workflows/typescript-ci.yaml b/.github/workflows/typescript-ci.yaml index 6ece889..78083c1 100644 --- a/.github/workflows/typescript-ci.yaml +++ b/.github/workflows/typescript-ci.yaml @@ -46,7 +46,7 @@ jobs: run: yarn run test - name: Check test coverage if: ${{ contains(matrix.os, 'ubuntu') && matrix.node_version == '10' && matrix.rust_version - == 'stable' }} + == 'stable' }} && github.base_ref != '' uses: anuraag016/Jest-Coverage-Diff@V1.1 with: fullCoverageDiff: false @@ -82,12 +82,5 @@ jobs: run: yarn run compile - name: Run tests run: yarn run test - - name: Check test coverage - if: ${{ contains(matrix.os, 'ubuntu') && matrix.node_version == '10' && matrix.rust_version - == 'stable' }} - uses: anuraag016/Jest-Coverage-Diff@V1.1 - with: - fullCoverageDiff: false - delta: 0.2 container: image: node:${{ matrix.node_version }}-alpine From 60fe1b5be624009b698821a94a7095f4e39426ed Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Mon, 14 Jun 2021 16:02:30 -0600 Subject: [PATCH 2/3] Upload to the upload URL. --- .github/workflows/publish.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 3716c76..5ad4476 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -56,7 +56,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: ${{ github.event.release.assets_url }} + upload_url: ${{ github.event.release.upload_url }} asset_path: bin-package/${{ steps.build.outputs.asset }} asset_name: ${{ steps.build.outputs.asset }} asset_content_type: application/gzip @@ -96,7 +96,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: ${{ github.event.release.assets_url }} + upload_url: ${{ github.event.release.upload_url }} asset_path: bin-package/${{ steps.build.outputs.asset }} asset_name: ${{ steps.build.outputs.asset }} asset_content_type: application/gzip From c5238c94408ec2d90686a6915a52c988d8f7072c Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Mon, 14 Jun 2021 16:11:24 -0600 Subject: [PATCH 3/3] Fix if: syntax. --- .github/typescript-ci-patch.yaml | 2 +- .github/workflows/typescript-ci.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/typescript-ci-patch.yaml b/.github/typescript-ci-patch.yaml index 183110e..1c074ef 100644 --- a/.github/typescript-ci-patch.yaml +++ b/.github/typescript-ci-patch.yaml @@ -44,7 +44,7 @@ # Only check coverage in one of the matrix job instances. - op: add path: /jobs/test/steps/7/if - value: ${{ contains(matrix.os, 'ubuntu') && matrix.node_version == '10' && matrix.rust_version == 'stable' }} && github.base_ref != '' + value: ${{ contains(matrix.os, 'ubuntu') && matrix.node_version == '10' && matrix.rust_version == 'stable' && github.base_ref != '' }} # Also run on musl. That means we need to run it in a Docker container. To do that, we copy the entire job and modify its # strategy/matrix. diff --git a/.github/workflows/typescript-ci.yaml b/.github/workflows/typescript-ci.yaml index 78083c1..e336b7f 100644 --- a/.github/workflows/typescript-ci.yaml +++ b/.github/workflows/typescript-ci.yaml @@ -46,7 +46,7 @@ jobs: run: yarn run test - name: Check test coverage if: ${{ contains(matrix.os, 'ubuntu') && matrix.node_version == '10' && matrix.rust_version - == 'stable' }} && github.base_ref != '' + == 'stable' && github.base_ref != '' }} uses: anuraag016/Jest-Coverage-Diff@V1.1 with: fullCoverageDiff: false