diff --git a/.github/workflows/arm-runner.yml b/.github/workflows/arm-runner.yml index 8684a6fb..f659c6c4 100644 --- a/.github/workflows/arm-runner.yml +++ b/.github/workflows/arm-runner.yml @@ -36,6 +36,8 @@ jobs: base_image: ${{ matrix.base_image }} cpu: ${{ matrix.cpu }} cpu_info: ${{ matrix.cpu_info }} + copy_artifact_path: coverage.xml + copy_artifact_dest: ./coverage-${{ matrix.target }}.xml copy_repository_path: /opt/pynab optimize_image: no commands: | @@ -54,6 +56,14 @@ jobs: # And it also fails with aarch64 binaries of postgresql. sudo -u pi taskset -c 0 /bin/bash /opt/pynab/install.sh ci-chroot-test + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + file: ./coverage-${{ matrix.target }}.xml + fail_ci_if_error: true + flags: unittests-${{ matrix.target }} + token: ${{ secrets.CODECOV_TOKEN }} + create_image: name: Build image runs-on: ubuntu-latest diff --git a/README.md b/README.md index 823b301d..06d80eeb 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,17 @@ # Nabaztag en Python pour Raspberry Pi -[![build (qemu)](https://github.com/mtouzot/pynab/actions/workflows/arm-runner.yml/badge.svg?branch=main)](https://github.com/mtouzot/pynab/actions/workflows/arm-runner.yml) [![tests](https://github.com/mtouzot/pynab/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/mtouzot/pynab/actions/workflows/tests.yml) +[![build (raspberry pi)](https://github.com/mtouzot/pynab/actions/workflows/arm-runner.yml/badge.svg?branch=main)](https://github.com/mtouzot/pynab/actions/workflows/arm-runner.yml) +![coverage](https://codecov.io/gh/mtouzot/pynab/branch/main/graph/badge.svg) + +![lint](https://github.com/mtouzot/pynab/actions/workflows/python-lint.yml/badge.svg) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) +![release](https://img.shields.io/github/v/release/mtouzot/pynab) +![python](https://img.shields.io/badge/python-3.9-blue) + +![license](https://img.shields.io/github/license/mtouzot/pynab) + ## Cartes Ce système est conçu pour deux cartes pour **Nabaztag** (v1) et **Nabaztag:Tag** (v2) : @@ -112,4 +120,4 @@ Voir le [protocole nabd](PROTOCOL.md) ## Contribution -Vos contributions sont toujours les bienvenues ! Veuillez d'abord consulter les [directives de contribution](CONTRIBUTING.md). +Vos contributions sont toujours les bienvenues ! Veuillez d'abord consulter les [directives de contribution](CONTRIBUTING.md). \ No newline at end of file diff --git a/install.sh b/install.sh index 5b2acd86..e12a5509 100755 --- a/install.sh +++ b/install.sh @@ -380,10 +380,12 @@ else fi if [ $test -eq 1 ]; then - echo "Running tests" if [ $ci_chroot -eq 1 ]; then - sudo CI=1 venv/bin/pytest + echo "Running tests with coverage (CI chroot)" + sudo CI=1 venv/bin/coverage run -m pytest + sudo venv/bin/coverage xml -o /opt/pynab/coverage.xml else + echo "Running tests" sudo venv/bin/pytest fi fi