Skip to content

Commit ca6cd84

Browse files
authored
CHANGE: [CI] Upload coverage reports from Mac/Linux jobs & trigger coverage jobs on merge to develop (#2184)
1 parent ca289f1 commit ca6cd84

File tree

2 files changed

+18
-15
lines changed

2 files changed

+18
-15
lines changed

.github/codecov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ coverage:
1818
threshold: 1%
1919
base: auto
2020
if_ci_failed: success
21-
informational: false
21+
informational: true
2222
only_pulls: true
2323

2424
comment:

.yamato/upm-ci.yml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,8 @@
3737
- move /Y .\Packages\com.unity.inputsystem\Samples.meta .\Assets
3838
# Now run our full test suite that sits in Assets/Tests by running UTR on our project.
3939
- ./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 %}
40-
# Merge all the code coverage results into one report.
4140
{% if platform.name == "win" and category.name == "functional" %}
42-
- '{{ 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'
43-
# Delete the Package and Project reports, only keep the final merged one to keep Aritfacts.zip smaller
41+
# Delete the Package and Project reports & raw coverage data, to keep Artifacts.zip smaller
4442
- rmdir /s/q "{{ yamato_source_dir_win }}/upm-ci~/test-results/CodeCoverage/Package"
4543
- rmdir /s/q "{{ yamato_source_dir_win }}/upm-ci~/test-results/CodeCoverage/Project"
4644
{% endif %}
@@ -51,6 +49,11 @@
5149
UTR_Output.zip:
5250
paths:
5351
- "upm-ci~/test-results/**/*"
52+
{% if platform.name == "win" and category.name == "functional" %}
53+
triggers:
54+
expression: push.branch eq "develop"
55+
cancel_old_ci: true
56+
{% endif %}
5457
{% endfor %} # test_category
5558
{% endfor %} # platforms_win
5659

@@ -76,7 +79,7 @@
7679
- mv ./Assets/Samples.meta ./Packages/com.unity.inputsystem
7780
- upm-ci package pack --package-path ./Packages/com.unity.inputsystem/
7881
# Run upm-ci verification tests as well as tests contained in the package.
79-
- upm-ci package test --package-path ./Packages/com.unity.inputsystem/ -u $EDITOR_VERSION {% if category.name == "functional" and platform.name == "mac" or platform.name == "linux" %} --enable-code-coverage --code-coverage-options "generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.InputSystem;pathReplacePatterns:@*,,Library/PackageCache,Packages" --extra-utr-arg="--coverage-results-path={{ yamato_source_dir_nix }}/upm-ci~/test-results/CodeCoverage/Package" {% endif %}
82+
- upm-ci package test --package-path ./Packages/com.unity.inputsystem/ -u $EDITOR_VERSION {% if category.name == "functional" and platform.name == "mac" or platform.name == "linux" %} --enable-code-coverage --code-coverage-options "generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.InputSystem;pathReplacePatterns:@*,,Library/PackageCache,Packages" --extra-utr-arg="--coverage-results-path={{ yamato_source_dir_nix }}/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 %}
8083
{% if platform.installscript %}
8184
- {{ unity_downloader_install }}
8285
- {{ platform.installscript }} $EDITOR_VERSION
@@ -86,24 +89,24 @@
8689
- mv ./Packages/com.unity.inputsystem/Samples ./Assets
8790
- mv ./Packages/com.unity.inputsystem/Samples.meta ./Assets
8891
# Now run our full test suite that sits in Assets/Tests by running UTR on our project.
89-
- ./utr --testproject . --timeout=1200 --editor-location=.Editor --artifacts_path=upm-ci~/test-results/isolation-com.unity.inputsystem.tests --suite=playmode {% if platform.name == "mac" or platform.name == "linux"%} --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 category.name == "functional" and platform.name == "mac" or platform.name == "linux" %} --enable-code-coverage --coverage-options="generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.InputSystem" --coverage-results-path={{ yamato_source_dir_nix }}/upm-ci~/test-results/CodeCoverage/Project {% endif %}
90-
# Merge all the code coverage results into one report.
91-
{% if platform.name == "mac" and category.name == "functional" %}
92-
- '{{ yamato_source_dir_nix }}/.Editor/Unity.app/Contents/MacOS/Unity -projectPath {{ yamato_source_dir_nix }} -batchmode -debugCodeOptimization -enableCodeCoverage -coverageResultsPath {{ yamato_source_dir_nix }}/upm-ci~/test-results/CodeCoverage/ -coverageOptions "generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.InputSystem;sourcePaths:{{ yamato_source_dir_nix }}/Packages/com.unity.inputsystem/" -quit'
93-
{% endif %}
94-
{% if platform.name == "linux" and category.name == "functional" %}
95-
- '{{ yamato_source_dir_nix }}/.Editor/Unity -projectPath {{ yamato_source_dir_nix }} -batchmode -debugCodeOptimization -enableCodeCoverage -coverageResultsPath {{ yamato_source_dir_nix }}/upm-ci~/test-results/CodeCoverage/ -coverageOptions "generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.InputSystem;sourcePaths:{{ yamato_source_dir_nix }}/Packages/com.unity.inputsystem/" -quit'
96-
{% endif %}
97-
# Delete the Package and Project reports, only keep the final merged one to keep Aritfacts.zip smaller
92+
- ./utr --testproject . --timeout=1200 --editor-location=.Editor --artifacts_path=upm-ci~/test-results/isolation-com.unity.inputsystem.tests --suite=playmode {% if platform.name == "mac" or platform.name == "linux"%} --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 category.name == "functional" and platform.name == "mac" or platform.name == "linux" %} --enable-code-coverage --coverage-options="generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.InputSystem" --coverage-results-path={{ yamato_source_dir_nix }}/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 %}
93+
{% if category.name == "functional" and platform.name == "mac" or platform.name == "linux"%}
94+
# Delete the Package and Project reports & raw coverage data, to keep Artifacts.zip smaller
9895
- rm -rf {{ yamato_source_dir_nix }}/upm-ci~/test-results/CodeCoverage/Package
99-
- rm -rf {{ yamato_source_dir_nix }}/upm-ci~/test-results/CodeCoverage/Project
96+
- rm -rf {{ yamato_source_dir_nix }}/upm-ci~/test-results/CodeCoverage/Project
97+
{% endif %}
10098
after:
10199
- {{ instabilities_install_nix }}
102100
- {{ platform.instabilities_run }}
103101
artifacts:
104102
UTR_Output.zip:
105103
paths:
106104
- "upm-ci~/test-results/**/*"
105+
{% if category.name == "functional" and platform.name == "mac" or platform.name == "linux"%}
106+
triggers:
107+
expression: push.branch eq "develop"
108+
cancel_old_ci: true
109+
{% endif %}
107110
{% endfor %} # test_category
108111
{% endfor %} # platforms_nix
109112
{% endfor %} # editors

0 commit comments

Comments
 (0)