Skip to content

chore: add codecov #1699

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

Merged
merged 1 commit into from
Jul 12, 2023
Merged
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
17 changes: 17 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
codecov:
# https://docs.codecov.io/docs/comparing-commits
allow_coverage_offsets: true
coverage:
status:
project:
default:
informational: true
target: auto # auto compares coverage to the previous base commit
flags:
- docarray
comment:
layout: "reach, diff, flags, files"
behavior: default
require_changes: false # if true: only post the comment if coverage changes
branches: # branch names that can post comment
- "master"
134 changes: 114 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,23 +111,26 @@ jobs:
- name: Test
id: test
run: |
poetry run pytest -m "not (tensorflow or benchmark or index)" ${{ matrix.test-path }} --ignore=tests/integrations/store/test_jac.py
poetry run pytest -m "not (tensorflow or benchmark or index)" --cov=docarray --cov-report=xml ${{ matrix.test-path }} --ignore=tests/integrations/store/test_jac.py
echo "flag it as docarray for codeoverage"
echo "codecov_flag=docarray" >> $GITHUB_OUTPUT
timeout-minutes: 30
env:
JINA_AUTH_TOKEN: "${{ secrets.JINA_AUTH_TOKEN }}"
# - name: Check codecov file
# id: check_files
# uses: andstor/file-existence-action@v1
# with:
# files: "coverage.xml"
# - name: Upload coverage from test to Codecov
# uses: codecov/codecov-action@v3.1.1
# if: steps.check_files.outputs.files_exists == 'true' && ${{ matrix.python-version }} == '3.8'
# with:
# file: coverage.xml
# flags: ${{ steps.test.outputs.codecov_flag }}
# fail_ci_if_error: false
# token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
- name: Check codecov file
id: check_files
uses: andstor/file-existence-action@v1
with:
files: "coverage.xml"
- name: Upload coverage from test to Codecov
uses: codecov/codecov-action@v3.1.1
if: steps.check_files.outputs.files_exists == 'true' && ${{ matrix.python-version }} == '3.8'
with:
file: coverage.xml
name: benchmark-test-codecov
flags: ${{ steps.test.outputs.codecov_flag }}
fail_ci_if_error: false



docarray-test-jac:
Expand Down Expand Up @@ -155,10 +158,25 @@ jobs:
- name: Test
id: test
run: |
poetry run pytest -m "not (tensorflow or benchmark or index)" tests/integrations/store/test_jac.py
poetry run pytest -m "not (tensorflow or benchmark or index)" --cov=docarray --cov-report=xml tests/integrations/store/test_jac.py
echo "flag it as docarray for codeoverage"
echo "codecov_flag=docarray" >> $GITHUB_OUTPUT
timeout-minutes: 30
env:
JINA_AUTH_TOKEN: "${{ secrets.JINA_AUTH_TOKEN }}"
- name: Check codecov file
id: check_files
uses: andstor/file-existence-action@v1
with:
files: "coverage.xml"
- name: Upload coverage from test to Codecov
uses: codecov/codecov-action@v3.1.1
if: steps.check_files.outputs.files_exists == 'true' && ${{ matrix.python-version }} == '3.8'
with:
file: coverage.xml
name: benchmark-test-codecov
flags: ${{ steps.test.outputs.codecov_flag }}
fail_ci_if_error: false


docarray-test-proto3:
Expand All @@ -185,8 +203,23 @@ jobs:
- name: Test
id: test
run: |
poetry run pytest -m 'proto' tests
poetry run pytest -m 'proto' --cov=docarray --cov-report=xml tests
echo "flag it as docarray for codeoverage"
echo "codecov_flag=docarray" >> $GITHUB_OUTPUT
timeout-minutes: 30
- name: Check codecov file
id: check_files
uses: andstor/file-existence-action@v1
with:
files: "coverage.xml"
- name: Upload coverage from test to Codecov
uses: codecov/codecov-action@v3.1.1
if: steps.check_files.outputs.files_exists == 'true' && ${{ matrix.python-version }} == '3.8'
with:
file: coverage.xml
name: benchmark-test-codecov
flags: ${{ steps.test.outputs.codecov_flag }}
fail_ci_if_error: false


docarray-doc-index:
Expand Down Expand Up @@ -216,8 +249,23 @@ jobs:
- name: Test
id: test
run: |
poetry run pytest -m 'index and not elasticv8' tests/index/${{ matrix.db_test_folder }}
poetry run pytest -m 'index and not elasticv8' --cov=docarray --cov-report=xml tests/index/${{ matrix.db_test_folder }}
echo "flag it as docarray for codeoverage"
echo "codecov_flag=docarray" >> $GITHUB_OUTPUT
timeout-minutes: 30
- name: Check codecov file
id: check_files
uses: andstor/file-existence-action@v1
with:
files: "coverage.xml"
- name: Upload coverage from test to Codecov
uses: codecov/codecov-action@v3.1.1
if: steps.check_files.outputs.files_exists == 'true' && ${{ matrix.python-version }} == '3.8'
with:
file: coverage.xml
name: benchmark-test-codecov
flags: ${{ steps.test.outputs.codecov_flag }}
fail_ci_if_error: false


docarray-elastic-v8:
Expand Down Expand Up @@ -247,8 +295,23 @@ jobs:
- name: Test
id: test
run: |
poetry run pytest -m 'index and elasticv8' tests
poetry run pytest -m 'index and elasticv8' --cov=docarray --cov-report=xml tests
echo "flag it as docarray for codeoverage"
echo "codecov_flag=docarray" >> $GITHUB_OUTPUT
timeout-minutes: 30
- name: Check codecov file
id: check_files
uses: andstor/file-existence-action@v1
with:
files: "coverage.xml"
- name: Upload coverage from test to Codecov
uses: codecov/codecov-action@v3.1.1
if: steps.check_files.outputs.files_exists == 'true' && ${{ matrix.python-version }} == '3.8'
with:
file: coverage.xml
name: benchmark-test-codecov
flags: ${{ steps.test.outputs.codecov_flag }}
fail_ci_if_error: false

docarray-test-tensorflow:
needs: [import-test]
Expand Down Expand Up @@ -276,8 +339,24 @@ jobs:
- name: Test
id: test
run: |
poetry run pytest -m 'tensorflow' tests
poetry run pytest -m 'tensorflow' --cov=docarray --cov-report=xml tests
echo "flag it as docarray for codeoverage"
echo "codecov_flag=docarray" >> $GITHUB_OUTPUT
timeout-minutes: 30
- name: Check codecov file
id: check_files
uses: andstor/file-existence-action@v1
with:
files: "coverage.xml"
- name: Upload coverage from test to Codecov
uses: codecov/codecov-action@v3.1.1
if: steps.check_files.outputs.files_exists == 'true' && ${{ matrix.python-version }} == '3.8'
with:
file: coverage.xml
name: benchmark-test-codecov
flags: ${{ steps.test.outputs.codecov_flag }}
fail_ci_if_error: false


docarray-test-benchmarks:
needs: [import-test]
Expand All @@ -301,8 +380,23 @@ jobs:
- name: Test
id: test
run: |
poetry run pytest -m 'benchmark' tests
poetry run pytest -m 'benchmark' --cov=docarray --cov-report=xml tests
echo "flag it as docarray for codeoverage"
echo "codecov_flag=docarray" >> $GITHUB_OUTPUT
timeout-minutes: 30
- name: Check codecov file
id: check_files
uses: andstor/file-existence-action@v1
with:
files: "coverage.xml"
- name: Upload coverage from test to Codecov
uses: codecov/codecov-action@v3.1.1
if: steps.check_files.outputs.files_exists == 'true' && ${{ matrix.python-version }} == '3.8'
with:
file: coverage.xml
name: benchmark-test-codecov
flags: ${{ steps.test.outputs.codecov_flag }}
fail_ci_if_error: false

# just for blocking the merge until all parallel tests are successful
success-all-test:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<a href="https://pypi.org/project/docarray/"><img src="https://img.shields.io/pypi/v/docarray?style=flat-square&amp;label=Release" alt="PyPI"></a>
<a href="https://codecov.io/gh/docarray/docarray"><img alt="Codecov branch" src="https://img.shields.io/codecov/c/github/docarray/docarray/main?logo=Codecov&logoColor=white&style=flat-square"></a>
<a href="https://bestpractices.coreinfrastructure.org/projects/6554"><img src="https://bestpractices.coreinfrastructure.org/projects/6554/badge"></a>
<a href="https://codecov.io/gh/docarray/docarray"><img alt="Codecov branch" src="https://img.shields.io/codecov/c/github/docarray/docarray/master?&logo=Codecov&logoColor=white&style=flat-square"></a>
<a href="https://pypistats.org/packages/docarray"><img alt="PyPI - Downloads from official pypistats" src="https://img.shields.io/pypi/dm/docarray?style=flat-square"></a>
<a href="https://discord.gg/WaMp6PVPgR"><img src="https://dcbadge.vercel.app/api/server/WaMp6PVPgR?theme=default-inverted&style=flat-square"></a>
</p>
Expand Down
Loading