Skip to content

Provide token for codecov upload #51

Provide token for codecov upload

Provide token for codecov upload #51

Workflow file for this run

name: CI
on: [push, pull_request, release] # runs on all branches
env:
PYTHON_VERSION: 3.12
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: false
- name: Install biopeaks
run: poetry install --no-interaction --with main,dev
- name: Install system dependencies for headless testing
run: sudo ./.devcontainer/install_system_dependencies.sh
- name: Test and collect coverage
run: pytest -v --cov-config=.coveragerc --cov-report=xml --cov=biopeaks
- name: Upload coverage report
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
build_distribution:
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: false
- name: Build and upload distribution
env:
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
poetry publish -u $PYPI_USERNAME -p $PYPI_PASSWORD --build