feat: upload test coverage to codcov on dev branch #24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy CodeCov | |
on: | |
push: | |
branches: | |
- main | |
- dev | |
permissions: | |
contents: read | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install socat -y | |
python -m pip install --upgrade pip | |
pip install poetry | |
poetry export -f requirements.txt --output requirements.txt --dev --without-hashes | |
pip install -r requirements.txt | |
- name: Build Extensions | |
run: | | |
python setup.py build_ext --inplace | |
- name: Run tests with coverage | |
run: | | |
pytest --cov=async_pyserial --cov-report=xml --cov-report=term | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v2 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./coverage.xml | |
flags: unittests | |
name: codecov-umbrella |