diff --git a/.github/workflows/notify-codecov.yml b/.github/workflows/notify-codecov.yml new file mode 100644 index 0000000000..30274cf000 --- /dev/null +++ b/.github/workflows/notify-codecov.yml @@ -0,0 +1,27 @@ +name: Notify Codecov + +on: + workflow_run: + workflows: + - "Contrib tests with LLMs" + - "Contrib tests without LLMs" + - "Core tests with LLMs" + - "Core tests without LLMs" + - "Integration tests" + - "Test with optional dependencies" + types: + - completed + +permissions: {} + +jobs: + notify: + runs-on: ubuntu-latest + if: github.event.workflow_run.conclusion == 'success' + steps: + - name: Send Codecov notification + uses: codecov/codecov-action@v3 + with: + run_command: send-notifications + token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: false diff --git a/autogen/dummy.py b/autogen/dummy.py new file mode 100644 index 0000000000..1e4e562a98 --- /dev/null +++ b/autogen/dummy.py @@ -0,0 +1,17 @@ +# Copyright (c) 2023 - 2025, AG2ai, Inc., AG2ai open-source projects maintainers and core contributors +# +# SPDX-License-Identifier: Apache-2.0 + +from math import ceil + + +def add(a: int, b: int) -> int: + return a + b + + +def ag2_ceil(x: float) -> int: + return ceil(x) + + +def sub(a: int, b: int) -> int: + return a - b diff --git a/codecov.yml b/codecov.yml index 1f9ff2d104..829d56d441 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,7 +1,8 @@ codecov: require_ci_to_pass: yes notify: - after_n_builds: 15 + # manual_trigger: true + after_n_builds: 30 wait_for_ci: yes coverage: @@ -9,21 +10,30 @@ coverage: project: default: # Basic settings - informational: true target: auto threshold: 1% - base: auto if_ci_failed: success + base: auto + branches: + - main patch: default: # Settings for new code in PRs - informational: true target: auto threshold: 1% + if_ci_failed: success base: auto # Configure codecov bot behavior -comment: false +comment: +# Show only changed files in PR comment + layout: "condensed_header, condensed_files, condensed_footer" + behavior: new + # Hide PR comment if there are no changes in coverage + require_changes: true + # Only post comment after all builds finish + after_n_builds: 30 + hide_project_coverage: true # Ignore certain paths/files ignore: diff --git a/test/test_dummy.py b/test/test_dummy.py new file mode 100644 index 0000000000..ebdb00df8f --- /dev/null +++ b/test/test_dummy.py @@ -0,0 +1,17 @@ +# Copyright (c) 2023 - 2025, AG2ai, Inc., AG2ai open-source projects maintainers and core contributors +# +# SPDX-License-Identifier: Apache-2.0 + +from autogen.dummy import add, ag2_ceil + + +def test_add() -> None: + actual = add(3, 5) + expected = 8 + assert actual == expected + + +def test_ag2_ceil() -> None: + actual = ag2_ceil(0.9) + expected = 1 + assert actual == expected