Skip to content
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

CI update #128

Merged
merged 5 commits into from
Nov 11, 2024
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
52 changes: 11 additions & 41 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,10 @@ jobs:
ref: ${{ github.head_ref }}

- name: Install dependencies
run: |
pip install pydoctor
curl -L "https://raw.githubusercontent.com/luxonis/python-api-analyzer-to-json/main/gen-docs.py" -o "gen-docs.py"
run: pip install pydoctor

- name: Build docs
run: |
python gen-docs.py depthai_nodes
run: pydoctor --docformat=plaintext depthai_nodes

tests:
needs:
Expand Down Expand Up @@ -96,43 +93,16 @@ jobs:
- name: Install package
run: pip install -e .[dev]

- name: Run pytest
uses: pavelzw/pytest-action@v2
with:
emoji: false
custom-arguments: --cov depthai_nodes --cov-report xml --junit-xml pytest.xml

- name: Create Test Report
uses: EnricoMi/publish-unit-test-result-action@v2
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.8'
with:
files: pytest.xml
- name: Run tests
run: pytest --cov=depthai_nodes --cov-report=xml --junitxml=junit.xml -o junit_family=legacy

- name: Generate coverage badge
uses: tj-actions/coverage-badge-py@v2
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.8'
- name: Upload results to Codecov
uses: codecov/codecov-action@v4
with:
output: media/coverage_badge.svg
token: ${{ secrets.CODECOV_TOKEN }}

- name: Generate coverage report
uses: orgoro/coverage@v3.1
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.8'
with:
coverageFile: coverage.xml
token: ${{ secrets.GITHUB_TOKEN }}

- name: Commit coverage badge
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.8'
run: |
git config --global user.name 'GitHub Actions'
git config --global user.email 'actions@github.com'
git add media/coverage_badge.svg
git diff --quiet --cached media/coverage_badge.svg || {
git commit -m "[Automated] Updated coverage badge"
}

- name: Push changes
uses: ad-m/github-push-action@master
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.8'
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
branch: ${{ github.head_ref }}
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

![CI](https://github.com/luxonis/depthai-nodes/actions/workflows/ci.yaml/badge.svg?event=pull_request)
![Coverage](https://github.com/luxonis/depthai-nodes/blob/dev/media/coverage_badge.svg)
[![codecov](https://codecov.io/gh/luxonis/depthai-nodes/graph/badge.svg?token=ZG493MZ07B)](https://codecov.io/gh/luxonis/depthai-nodes)

[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![Docformatter](https://img.shields.io/badge/%20formatter-docformatter-fedcba.svg)](https://github.com/PyCQA/docformatter)
Expand Down
Empty file removed media/.gitkeep
Empty file.
21 changes: 0 additions & 21 deletions media/coverage_badge.svg

This file was deleted.

Loading