Skip to content

Commit 5a5ae94

Browse files
authored
[skip-changelog] Extend code-coverage to integration test (#2103)
* Upgrade minimum go version to 1.20 * Updated license cache * Implemented code coverage in integration tests * Use gocovmerge to merge all coverage artifacts * Fixed build error on macOS dist The error was due to an increased git security constraints ... go: downloading github.com/xanzy/ssh-agent v0.2.1 go: downloading gopkg.in/warnings.v0 v0.1.2 error obtaining VCS status: exit status 128 Use -buildvcs=false to disable VCS stamping. Error: failed building for darwin/amd64: exit status 1 failed building for darwin/amd64: exit status 1 task: Failed to run task "dist:macOS_64bit": exit status 1 To fix this I followed the suggestion here elastic/golang-crossbuild#232 * Before killing the daemon, try a graceful shutdown Otherwise the process will not outut the coverage data.
1 parent 2b0dfb0 commit 5a5ae94

18 files changed

+130
-26
lines changed

.github/workflows/check-easyjson.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Check easyjson generated files
22

33
env:
44
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
5-
GO_VERSION: "1.19"
5+
GO_VERSION: "1.20"
66

77
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
88
on:

.github/workflows/check-go-dependencies-task.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Check Go Dependencies
33

44
env:
55
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
6-
GO_VERSION: "1.19"
6+
GO_VERSION: "1.20"
77

88
# See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows
99
on:

.github/workflows/check-go-task.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Check Go
33

44
env:
55
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
6-
GO_VERSION: "1.19"
6+
GO_VERSION: "1.20"
77

88
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
99
on:

.github/workflows/check-i18n-task.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Check Internationalization
22

33
env:
44
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
5-
GO_VERSION: "1.19"
5+
GO_VERSION: "1.20"
66

77
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
88
on:

.github/workflows/check-markdown-task.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ env:
55
# See: https://github.com/actions/setup-node/#readme
66
NODE_VERSION: 16.x
77
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
8-
GO_VERSION: "1.19"
8+
GO_VERSION: "1.20"
99

1010
# See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows
1111
on:

.github/workflows/check-mkdocs-task.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Check Website
33

44
env:
55
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
6-
GO_VERSION: "1.19"
6+
GO_VERSION: "1.20"
77
# See: https://github.com/actions/setup-python/tree/main#available-versions-of-python
88
PYTHON_VERSION: "3.9"
99

.github/workflows/check-protobuf-task.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Check Protocol Buffers
22

33
env:
44
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
5-
GO_VERSION: "1.19"
5+
GO_VERSION: "1.20"
66

77
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
88
on:

.github/workflows/deploy-cobra-mkdocs-versioned-poetry.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Deploy Website
33

44
env:
55
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
6-
GO_VERSION: "1.19"
6+
GO_VERSION: "1.20"
77
# See: https://github.com/actions/setup-python/tree/main#available-versions-of-python
88
PYTHON_VERSION: "3.9"
99

.github/workflows/i18n-weekly-pull.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: i18n-weekly-pull
22

33
env:
44
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
5-
GO_VERSION: "1.19"
5+
GO_VERSION: "1.20"
66
COVERAGE_ARTIFACT: coverage-data
77

88
on:

.github/workflows/test-go-task.yml

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Test Go
33

44
env:
55
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
6-
GO_VERSION: "1.19"
6+
GO_VERSION: "1.20"
77
COVERAGE_ARTIFACT: coverage-data
88

99
# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
@@ -110,6 +110,15 @@ jobs:
110110
run: |
111111
export GO_TEST_PACKAGE="github.com/arduino/arduino-cli/internal/integrationtest/${{ matrix.tests }}"
112112
task go:integration-test
113+
mv coverage_integration.txt coverage_integration_${{ matrix.operating-system }}_${{ matrix.tests }}.txt
114+
115+
- name: Upload coverage data to workflow artifact
116+
uses: actions/upload-artifact@v3
117+
with:
118+
if-no-files-found: error
119+
name: ${{ env.COVERAGE_ARTIFACT }}
120+
path: |
121+
./coverage_integration_*.txt
113122
114123
test:
115124
needs: run-determination
@@ -162,20 +171,32 @@ jobs:
162171
163172
coverage-upload:
164173
runs-on: ubuntu-latest
165-
needs: test
174+
needs:
175+
- test
176+
- test-integration
166177
steps:
167178
- name: Checkout repository
168179
uses: actions/checkout@v3
180+
181+
- name: Install Go
182+
uses: actions/setup-go@v3
183+
with:
184+
go-version: ${{ env.GO_VERSION }}
185+
186+
- name: Install gocovmerge
187+
run: go install github.com/wadey/gocovmerge@b5bfa59
188+
169189
- name: Download coverage data artifact
170190
uses: actions/download-artifact@v3
171191
with:
172192
name: ${{ env.COVERAGE_ARTIFACT }}
173193

194+
- name: Merge all code coverage artifacts
195+
run: gocovmerge coverage*.txt > coverage.txt
196+
174197
- name: Send unit tests coverage to Codecov
175198
uses: codecov/codecov-action@v3
176199
with:
177-
files: >
178-
./coverage_unit.txt,
179-
./coverage_legacy.txt
200+
files: ./coverage.txt
180201
flags: unit
181202
fail_ci_if_error: ${{ github.repository == 'arduino/arduino-cli' }}

0 commit comments

Comments
 (0)