Skip to content

Commit

Permalink
CI update (#128)
Browse files Browse the repository at this point in the history
* updated CI

* removed coverage badge

* updated badge in readme

* removed .gitkeep

* specified cov target
  • Loading branch information
kozlov721 authored Nov 11, 2024
1 parent ef25b04 commit b205b9e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 63 deletions.
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.

0 comments on commit b205b9e

Please sign in to comment.