Skip to content

Commit

Permalink
Merge pull request #1096 from dorssel/test_analytics
Browse files Browse the repository at this point in the history
Migrate to Codecov test analytics
  • Loading branch information
dorssel authored Dec 24, 2024
2 parents db70a0b + 944d933 commit b1232cd
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 15 deletions.
13 changes: 13 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": 1,
"isRoot": true,
"tools": {
"trx2junit": {
"version": "2.1.0",
"commands": [
"trx2junit"
],
"rollForward": false
}
}
}
3 changes: 3 additions & 0 deletions .config/dotnet-tools.json.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2024 Frans van Dorsselaer

SPDX-License-Identifier: GPL-3.0-only
33 changes: 21 additions & 12 deletions .github/workflows/build-installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:

- name: Install dependencies
run: |
dotnet tool restore
dotnet restore
dotnet restore Installer
Expand All @@ -50,18 +51,6 @@ jobs:
dotnet test --configuration Release --no-build `
-p:TestingPlatformCommandLineArguments="--report-trx --coverage --coverage-output-format cobertura --coverage-output coverage.cobertura.xml"
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action/windows@v2
if: always()
with:
files: |
**/TestResults/*.trx
- name: Codecov
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: Build (Installer)
run: |
dotnet publish --configuration Release --no-build Usbipd
Expand All @@ -73,3 +62,23 @@ jobs:
with:
name: msi-installer
path: 'Installer/bin/x64/release/*.msi'

- name: Convert test results
if: ${{ !cancelled() }}
shell: bash
run: |
find . -name "*.trx" -exec dotnet tool run trx2junit --output TestResults/JUnit {} +
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
fail_ci_if_error: true
files: TestResults/JUnit/*.xml
token: ${{ secrets.CODECOV_TOKEN }}

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
6 changes: 3 additions & 3 deletions .mega-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ XML_XMLLINT_FILE_EXTENSIONS:
- .wxs
# Exclude verbatim copies of external sources that are not under our control.
# Also exclude auto-generated files.
FILTER_REGEX_EXCLUDE: COPYING\.md|LICENSES/|Drivers/VBoxUSB/|Drivers/VBoxUSBMon/|packages.lock.json|Usbipd.Automation/usb.ids
# Dependabot keeps removing the final newline
JSON_PRETTIER_FILTER_REGEX_EXCLUDE: global.json
FILTER_REGEX_EXCLUDE: COPYING\.md|LICENSES/|Drivers/VBoxUSB/|Drivers/VBoxUSBMon/|global.json|dotnet-tools.json|packages.lock.json|Usbipd.Automation/usb.ids
# Exclude additional binary files not already excluded by default.
EDITORCONFIG_EDITORCONFIG_CHECKER_FILTER_REGEX_EXCLUDE: (\.snk$)

0 comments on commit b1232cd

Please sign in to comment.