Skip to content
47 changes: 47 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
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

# Components configuration
component_management:
individual_components:
- component_id: "com.unity.netcode.gameobjects"
name: "com.unity.netcode.gameobjects"
paths:
- com.unity.netcode.gameobjects
3 changes: 1 addition & 2 deletions .yamato/code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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/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:
Expand Down