[github] Enable code coverage collection.

- Set the `PULUMI_TEST_COVERAGE_PATH` environment variable during tests
- Use the codecov action to upload coverage data at the end of each leg
This commit is contained in:
Pat Gavlin 2021-10-19 11:01:29 -07:00
parent 9d233c0140
commit d2825522f2
5 changed files with 47 additions and 19 deletions

View file

@ -31,7 +31,7 @@ jobs:
language: ["nodejs", "python", "dotnet"]
steps:
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v1
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Set up Python ${{ matrix.python-version }}
@ -86,7 +86,7 @@ jobs:
go-version: [1.17.x]
steps:
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v1
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout Repo
@ -149,7 +149,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v1
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Set up Python ${{ matrix.python-version }}
@ -218,8 +218,11 @@ jobs:
- name: Set PULUMI_TEST_SUBSET env var
run: |
echo "PULUMI_TEST_SUBSET=${{ matrix.test-subset }}" >> $GITHUB_ENV
- name: Enable code coverage
run: |
echo "PULUMI_TEST_COVERAGE_PATH=$(pwd)/coverage" >> $GITHUB_ENV
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v1
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Set up Python ${{ matrix.python-version }}
@ -285,6 +288,17 @@ jobs:
PULUMI_NODE_MODULES: ${{ runner.temp }}/opt/pulumi/node_modules
PULUMI_LOCAL_NUGET: ${{ runner.temp }}/opt/pulumi/nuget
PULUMI_ROOT: ${{ runner.temp }}/opt/pulumi
- name: Merge Go coverage data
run: |
covmerge -in ./coverage -out ./coverage/go-all.txt
rm ./coverage/*.cov
- name: Upload code coverage
uses: codecov/codecov-action@v2
with:
directory: coverage
files: '*'
fail_ci_if_error: true
verbose: true
windows-build:
name: Windows Build + Test + Publish
strategy:
@ -314,7 +328,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v1
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Set up Python ${{ matrix.python-version }}

View file

@ -31,7 +31,7 @@ jobs:
language: ["nodejs", "python", "dotnet"]
steps:
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v1
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Set up Python ${{ matrix.python-version }}
@ -85,7 +85,7 @@ jobs:
go-version: [1.17.x]
steps:
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v1
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout Repo
@ -132,7 +132,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v1
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Set up Python ${{ matrix.python-version }}
@ -196,7 +196,7 @@ jobs:
runs-on: ${{ matrix.platform }}
steps:
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v1
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Set up Python ${{ matrix.python-version }}
@ -291,7 +291,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v1
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Set up Python ${{ matrix.python-version }}

View file

@ -123,7 +123,7 @@ jobs:
language: ["nodejs", "python", "dotnet"]
steps:
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v1
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Set up Python ${{ matrix.python-version }}
@ -177,7 +177,7 @@ jobs:
go-version: [1.17.x]
steps:
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v1
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout Repo
@ -225,7 +225,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v1
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Set up Python ${{ matrix.python-version }}
@ -295,7 +295,7 @@ jobs:
run: |
echo "PULUMI_TEST_SUBSET=${{ matrix.test-subset }}" >> $GITHUB_ENV
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v1
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Set up Python ${{ matrix.python-version }}
@ -397,7 +397,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v1
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Set up Python ${{ matrix.python-version }}

View file

@ -71,7 +71,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v1
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Set up Python ${{ matrix.python-version }}
@ -159,8 +159,11 @@ jobs:
- name: Set PULUMI_TEST_SUBSET env var
run: |
echo "PULUMI_TEST_SUBSET=${{ matrix.test-subset }}" >> $GITHUB_ENV
- name: Enable code coverage
run: |
echo "PULUMI_TEST_COVERAGE_PATH=$(pwd)/coverage" >> $GITHUB_ENV
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v1
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Set up Python ${{ matrix.python-version }}
@ -236,6 +239,17 @@ jobs:
PULUMI_NODE_MODULES: ${{ runner.temp }}/opt/pulumi/node_modules
PULUMI_LOCAL_NUGET: ${{ runner.temp }}/opt/pulumi/nuget
PULUMI_ROOT: ${{ runner.temp }}/opt/pulumi
- name: Merge Go coverage data
run: |
covmerge -in ./coverage -out ./coverage/go-all.txt
rm ./coverage/*.cov
- name: Upload code coverage
uses: codecov/codecov-action@v2
with:
directory: coverage
files: '*'
fail_ci_if_error: true
verbose: true
- name: Summarize Test Time by Package
run: |
mkdir -p test-results
@ -270,7 +284,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v1
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Set up Python ${{ matrix.python-version }}

View file

@ -40,7 +40,7 @@ jobs:
fail-fast: false
steps:
- name: Install Go
uses: actions/setup-go@v1
uses: actions/setup-go@v2
with:
go-version: 1.17.x
- name: Install Node.js