Skip to content

Commit

Permalink
feat: add in github action to upload code coverage results (#245)
Browse files Browse the repository at this point in the history
  • Loading branch information
wmundev committed Apr 20, 2024
1 parent 6f58430 commit 3ce7e19
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/build_and_run_unit_tests_linux.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: build_and_run_unit_tests_linux

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/build_and_run_unit_tests_windows.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: build_and_run_unit_tests_windows

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/run_all_tests_and_upload_code_coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "run_all_tests_and_upload_code_coverage"

on:
push:
branches: [ main ]

jobs:
run_all_tests_and_upload_code_coverage:
runs-on: windows-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
- name: Add zip files required for running tests
run: |
Compress-Archive -Path "resources\geocoding\*" -DestinationPath "resources\geocoding.zip"
Compress-Archive -Path "resources\test\geocoding\*" -DestinationPath "resources\test\testgeocoding.zip"
- name: Run tests
run: dotnet test csharp/PhoneNumbers.sln --configuration Release --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.3.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: twcclegg/libphonenumber-csharp

0 comments on commit 3ce7e19

Please sign in to comment.