Skip to content

Add GitHub Actions lint and test workflows, coverage file, and test s… #1

Add GitHub Actions lint and test workflows, coverage file, and test s…

Add GitHub Actions lint and test workflows, coverage file, and test s… #1

Workflow file for this run

name: Tests
on:
push:
branches: ['**']
pull_request:
branches: ['**']
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Configure git for tests
run: |
git config --global user.email "test@example.com"
git config --global user.name "Test User"
git config --global init.defaultBranch master
- name: Run tests with coverage
run: |
pytest --cov=src/ab_cli --cov-report=xml --cov-report=term -v
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
if: matrix.python-version == '3.12'
with:
files: ./coverage.xml
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}