Skip to content

ci: Integrating CodeCov with NGO repo [develop] #3476

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -39,7 +38,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:NGOv1_{{ platform.name }}_{{ editor }};flags:NGOv1_{{ 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