From 687ff521166ee60612a70344b9a4ee8455330fd9 Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Mon, 2 Jun 2025 18:40:08 +0200 Subject: [PATCH 1/6] Added codecov file --- .github/codecov.yml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/codecov.yml diff --git a/.github/codecov.yml b/.github/codecov.yml new file mode 100644 index 0000000000..de025f28a1 --- /dev/null +++ b/.github/codecov.yml @@ -0,0 +1,39 @@ +codecov: + require_ci_to_pass: false + notify: + wait_for_ci: true + +coverage: + precision: 2 + round: down + range: "50...70" + status: + patch: + default: + if_ci_failed: success + informational: true + default_rules: + flag_coverage_not_uploaded_behavior: exclude + project: + default: + target: auto + # Threshold used for the PR Check + threshold: 0.5% + base: auto + if_ci_failed: success + informational: true + only_pulls: true + +# PR Comment configuration +comment: + layout: "diff, flags, files, components" + behavior: default + require_changes: false + require_base: false + require_head: false + # Set this to the number of coverage jobs run in the PR + after_n_builds: 1 + +flag_management: + default_rules: + carryforward: true From e31b96704d93855504d3519f03abe4fc6ebafee8 Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Mon, 2 Jun 2025 18:55:43 +0200 Subject: [PATCH 2/6] Updated code-coverage job --- .yamato/code-coverage.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.yamato/code-coverage.yml b/.yamato/code-coverage.yml index ced6277452..918c7d28fd 100644 --- a/.yamato/code-coverage.yml +++ b/.yamato/code-coverage.yml @@ -21,7 +21,6 @@ # In order to properly use -coverage-results-path parameter we need to start it with $PWD (which means the absolute path). Otherwise coverage results will not be visible # QUALITY CONSIDERATIONS-------------------------------------------------------------------- - # TODO: somewhere in 2025 we will be able to upload resuls to CodeCov from public repos # To see where this job is included (in trigger job definitions) look into _triggers.yml file @@ -40,7 +39,7 @@ code_coverage_{{ platform.name }}_{{ editor }}: commands: - unity-downloader-cli --fast --wait -u {{ editor }} -c Editor {% if platform.name == "mac" %} --arch arm64 {% endif %} # For macOS we use ARM64 models - upm-pvp create-test-project test-project --packages "upm-ci~/packages/*.tgz" --unity .Editor - - UnifiedTestRunner --suite=editor --suite=playmode --editor-location=.Editor --testproject=test-project --enable-code-coverage -coverage-results-path=$PWD/test-results/CodeCoverage --coverage-options="generateHtmlReport;generateAdditionalMetrics;assemblyFilters:+Unity.Netcode.Editor,+Unity.Netcode.Runtime" --extra-editor-arg=--burst-disable-compilation --timeout=1800 --reruncount=1 --clean-library-on-rerun --artifacts-path=test-results + - UnifiedTestRunner --suite=editor --suite=playmode --editor-location=.Editor --testproject=test-project --enable-code-coverage --coverage-upload-options=\"reportsDir:$PWD/test-results/CodeCoverage;name:NetcodeForGameobjects_ubuntu_trunk;flags:NetcodeForGameobjects_ubuntu_trunk\" --coverage-results-path=$PWD/test-results/CodeCoverage --coverage-options="generateHtmlReport;generateAdditionalMetrics;assemblyFilters:+Unity.Netcode.Editor,+Unity.Netcode.Runtime" --extra-editor-arg=--burst-disable-compilation --timeout=1800 --reruncount=1 --clean-library-on-rerun --artifacts-path=test-results artifacts: logs: paths: From efbc80dd4aa02b4c6159c601c0b010bdf0a001a4 Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Fri, 13 Jun 2025 13:26:52 +0200 Subject: [PATCH 3/6] Added component configuration as per docs --- .github/codecov.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/codecov.yml b/.github/codecov.yml index de025f28a1..d919d6f2f9 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -37,3 +37,11 @@ comment: flag_management: default_rules: carryforward: true + +# Components configuration +component_management: + individual_components: + - component_id: "com.unity.netcode.gameobjects" + name: "Netcode for GameObjects" + paths: + - com.unity.netcode.gameobjects \ No newline at end of file From 8787e009f4d13c3206940e9e1d0ea4c740801429 Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Fri, 13 Jun 2025 13:29:29 +0200 Subject: [PATCH 4/6] Corrected coverage upload command --- .yamato/code-coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.yamato/code-coverage.yml b/.yamato/code-coverage.yml index 918c7d28fd..aee644ea73 100644 --- a/.yamato/code-coverage.yml +++ b/.yamato/code-coverage.yml @@ -39,7 +39,7 @@ code_coverage_{{ platform.name }}_{{ editor }}: commands: - unity-downloader-cli --fast --wait -u {{ editor }} -c Editor {% if platform.name == "mac" %} --arch arm64 {% endif %} # For macOS we use ARM64 models - upm-pvp create-test-project test-project --packages "upm-ci~/packages/*.tgz" --unity .Editor - - UnifiedTestRunner --suite=editor --suite=playmode --editor-location=.Editor --testproject=test-project --enable-code-coverage --coverage-upload-options=\"reportsDir:$PWD/test-results/CodeCoverage;name:NetcodeForGameobjects_ubuntu_trunk;flags:NetcodeForGameobjects_ubuntu_trunk\" --coverage-results-path=$PWD/test-results/CodeCoverage --coverage-options="generateHtmlReport;generateAdditionalMetrics;assemblyFilters:+Unity.Netcode.Editor,+Unity.Netcode.Runtime" --extra-editor-arg=--burst-disable-compilation --timeout=1800 --reruncount=1 --clean-library-on-rerun --artifacts-path=test-results + - UnifiedTestRunner --suite=editor --suite=playmode --editor-location=.Editor --testproject=test-project --enable-code-coverage coverage-upload-options="reportsDir:$PWD/test-results/CoverageResults;name:NGO_{{ platform.name }}_{{ editor }};flags:NGO_{{ platform.name }}_{{ editor }};verbose" --coverage-results-path=$PWD/test-results/CoverageResults --coverage-options="generateHtmlReport;generateAdditionalMetrics;assemblyFilters:+Unity.Netcode.Editor,+Unity.Netcode.Runtime" --extra-editor-arg=--burst-disable-compilation --timeout=1800 --reruncount=1 --clean-library-on-rerun --artifacts-path=test-results artifacts: logs: paths: From 97b9b2a9b56ee9a0681694ae84ecadb5a6cf2593 Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Fri, 13 Jun 2025 13:32:19 +0200 Subject: [PATCH 5/6] Corrected name to underline that we are talking about 2.X version --- .yamato/code-coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.yamato/code-coverage.yml b/.yamato/code-coverage.yml index aee644ea73..688fa2e03f 100644 --- a/.yamato/code-coverage.yml +++ b/.yamato/code-coverage.yml @@ -39,7 +39,7 @@ code_coverage_{{ platform.name }}_{{ editor }}: commands: - unity-downloader-cli --fast --wait -u {{ editor }} -c Editor {% if platform.name == "mac" %} --arch arm64 {% endif %} # For macOS we use ARM64 models - upm-pvp create-test-project test-project --packages "upm-ci~/packages/*.tgz" --unity .Editor - - UnifiedTestRunner --suite=editor --suite=playmode --editor-location=.Editor --testproject=test-project --enable-code-coverage coverage-upload-options="reportsDir:$PWD/test-results/CoverageResults;name:NGO_{{ platform.name }}_{{ editor }};flags:NGO_{{ platform.name }}_{{ editor }};verbose" --coverage-results-path=$PWD/test-results/CoverageResults --coverage-options="generateHtmlReport;generateAdditionalMetrics;assemblyFilters:+Unity.Netcode.Editor,+Unity.Netcode.Runtime" --extra-editor-arg=--burst-disable-compilation --timeout=1800 --reruncount=1 --clean-library-on-rerun --artifacts-path=test-results + - UnifiedTestRunner --suite=editor --suite=playmode --editor-location=.Editor --testproject=test-project --enable-code-coverage coverage-upload-options="reportsDir:$PWD/test-results/CoverageResults;name:NGOv2_{{ platform.name }}_{{ editor }};flags:NGOv2_{{ platform.name }}_{{ editor }};verbose" --coverage-results-path=$PWD/test-results/CoverageResults --coverage-options="generateHtmlReport;generateAdditionalMetrics;assemblyFilters:+Unity.Netcode.Editor,+Unity.Netcode.Runtime" --extra-editor-arg=--burst-disable-compilation --timeout=1800 --reruncount=1 --clean-library-on-rerun --artifacts-path=test-results artifacts: logs: paths: From 39af8938df1b96c708a8b68ab79514ddf1861646 Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Fri, 13 Jun 2025 13:37:41 +0200 Subject: [PATCH 6/6] Updated component name --- .github/codecov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/codecov.yml b/.github/codecov.yml index d919d6f2f9..a5fa7c59af 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -42,6 +42,6 @@ flag_management: component_management: individual_components: - component_id: "com.unity.netcode.gameobjects" - name: "Netcode for GameObjects" + name: "com.unity.netcode.gameobjects" paths: - com.unity.netcode.gameobjects \ No newline at end of file