Skip to content

Commit 3ce7e19

Browse files
authored
feat: add in github action to upload code coverage results (#245)
1 parent 6f58430 commit 3ce7e19

3 files changed

+27
-4
lines changed

.github/workflows/build_and_run_unit_tests_linux.yml

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: build_and_run_unit_tests_linux
22

33
on:
4-
push:
5-
branches: [ "main" ]
64
pull_request:
75
branches: [ "main" ]
86
workflow_dispatch:

.github/workflows/build_and_run_unit_tests_windows.yml

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: build_and_run_unit_tests_windows
22

33
on:
4-
push:
5-
branches: [ "main" ]
64
pull_request:
75
branches: [ "main" ]
86
workflow_dispatch:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: "run_all_tests_and_upload_code_coverage"
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
jobs:
8+
run_all_tests_and_upload_code_coverage:
9+
runs-on: windows-latest
10+
timeout-minutes: 20
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Setup .NET
14+
uses: actions/setup-dotnet@v4
15+
with:
16+
dotnet-version: 8.x
17+
- name: Add zip files required for running tests
18+
run: |
19+
Compress-Archive -Path "resources\geocoding\*" -DestinationPath "resources\geocoding.zip"
20+
Compress-Archive -Path "resources\test\geocoding\*" -DestinationPath "resources\test\testgeocoding.zip"
21+
- name: Run tests
22+
run: dotnet test csharp/PhoneNumbers.sln --configuration Release --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage
23+
- name: Upload coverage reports to Codecov
24+
uses: codecov/codecov-action@v4.3.0
25+
with:
26+
token: ${{ secrets.CODECOV_TOKEN }}
27+
slug: twcclegg/libphonenumber-csharp

0 commit comments

Comments
 (0)