Skip to content

Commit ca289f1

Browse files
authored
CHANGE: [CI] Upload code coverage reports to Codecov server (#2181)
1 parent 6601e91 commit ca289f1

File tree

2 files changed

+36
-3
lines changed

2 files changed

+36
-3
lines changed

.github/codecov.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
codecov:
2+
max_report_age: false
3+
require_ci_to_pass: false
4+
notify:
5+
wait_for_ci: true
6+
7+
coverage:
8+
precision: 2
9+
round: down
10+
range: "50...70"
11+
status:
12+
patch: true
13+
default_rules:
14+
flag_coverage_not_uploaded_behavior: exclude
15+
project:
16+
default:
17+
target: auto
18+
threshold: 1%
19+
base: auto
20+
if_ci_failed: success
21+
informational: false
22+
only_pulls: true
23+
24+
comment:
25+
layout: "diff,flags,files"
26+
behavior: default
27+
require_changes: false
28+
require_base: true
29+
require_head: true
30+
after_n_builds: 1
31+
32+
flag_management:
33+
default_rules:
34+
carryforward: true

.yamato/upm-ci.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
- upm-ci package pack --package-path ./Packages/com.unity.inputsystem/
2727
# Run upm-ci verification tests as well as tests contained in the package.
2828
- upm-ci package test --package-path ./Packages/com.unity.inputsystem/ -u %EDITOR_VERSION%
29-
{% if platform.name == "win" and category.name == "functional" %} --enable-code-coverage --code-coverage-options "generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.InputSystem;pathReplacePatterns:@*,,Library/PackageCache,Packages"
30-
--extra-utr-arg="--coverage-results-path={{ yamato_source_dir_win }}/upm-ci~/test-results/CodeCoverage/Package" {% endif %}
29+
{% if platform.name == "win" and category.name == "functional" %} --enable-code-coverage --code-coverage-options "generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.InputSystem;pathReplacePatterns:@*,,Library/PackageCache,Packages" --extra-utr-arg="--coverage-results-path={{ yamato_source_dir_win }}/upm-ci~/test-results/CodeCoverage/Package --coverage-upload-options=\"reportsDir:upm-ci~/test-results/CodeCoverage/Package;name:{{platform.name}}_{{editor.version}}_pkg;flags:{{platform.name}}_{{editor.version}}_pkg\"" {% endif %}
3130
{% if platform.installscript %}
3231
- {{ unity_downloader_install }}
3332
- {{ platform.installscript }} %EDITOR_VERSION%
@@ -37,7 +36,7 @@
3736
- move /Y .\Packages\com.unity.inputsystem\Samples .\Assets
3837
- move /Y .\Packages\com.unity.inputsystem\Samples.meta .\Assets
3938
# Now run our full test suite that sits in Assets/Tests by running UTR on our project.
40-
- ./utr --testproject . --timeout=1200 --editor-location=.Editor --artifacts_path=upm-ci~/test-results/isolation-com.unity.inputsystem.tests --suite=playmode {% if platform.name == "win" %} --suite=editor {% endif %} {% if category.name == "performance" %} --category=Performance {% else %} --category=!Performance {% endif %} --api-profile=NET_4_6 {% if platform.runtime %} --platform {{ platform.runtime }} {% endif %} {% if platform.scripting-backend %} --scripting-backend {{ platform.scripting-backend }} {% endif %} {% if category.name == "performance" %} --report-performance-data --performance-project-id=InputSystem {% endif %} {% if platform.name == "win" and category.name == "functional" %}--enable-code-coverage --coverage-options="generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.InputSystem" --coverage-results-path={{ yamato_source_dir_win }}/upm-ci~/test-results/CodeCoverage/Project {% endif %}
39+
- ./utr --testproject . --timeout=1200 --editor-location=.Editor --artifacts_path=upm-ci~/test-results/isolation-com.unity.inputsystem.tests --suite=playmode {% if platform.name == "win" %} --suite=editor {% endif %} {% if category.name == "performance" %} --category=Performance {% else %} --category=!Performance {% endif %} --api-profile=NET_4_6 {% if platform.runtime %} --platform {{ platform.runtime }} {% endif %} {% if platform.scripting-backend %} --scripting-backend {{ platform.scripting-backend }} {% endif %} {% if category.name == "performance" %} --report-performance-data --performance-project-id=InputSystem {% endif %} {% if platform.name == "win" and category.name == "functional" %}--enable-code-coverage --coverage-options="generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.InputSystem" --coverage-results-path={{ yamato_source_dir_win }}/upm-ci~/test-results/CodeCoverage/Project --coverage-upload-options="reportsDir:upm-ci~/test-results/CodeCoverage/Project;name:{{platform.name}}_{{editor.version}}_project;flags:{{platform.name}}_{{editor.version}}_project" {% endif %}
4140
# Merge all the code coverage results into one report.
4241
{% if platform.name == "win" and category.name == "functional" %}
4342
- '{{ yamato_source_dir_win }}/.Editor/Unity.exe -projectPath {{ yamato_source_dir_win }} -batchmode -debugCodeOptimization -enableCodeCoverage -coverageResultsPath {{ yamato_source_dir_win }}/upm-ci~/test-results/CodeCoverage/ -coverageOptions "generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.InputSystem;sourcePaths:{{ yamato_source_dir_win }}/Packages/com.unity.inputsystem/" -quit'

0 commit comments

Comments
 (0)