Skip to content

Fixing the merging of coverage #19

Fixing the merging of coverage

Fixing the merging of coverage #19

Workflow file for this run

name: Run Tests
on:
push:
branches: [ '*' ]
pull_request:
branches: [ '*' ]
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.10', '3.11', '3.12', '3.13' ]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install pytest pytest-cov respx
pip install -e .
- name: Test with pytest
run: |
pytest -xvs tests/ --cov=arcsecond --cov-report=xml --cov-report=term
- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.python-version }}
path: .coverage
scan:
runs-on: ubuntu-latest
needs: tests
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Download all coverage artifacts
uses: actions/download-artifact@v4
with:
path: coverages
- name: Install coverage.py
run: pip install coverage
- name: Merge coverage files
run: |
coverage combine coverages
coverage xml -o coverage.xml
- name: SonarQube Scan
uses: SonarSource/sonarcloud-github-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 black isort
- name: Lint with flake8
run: |
flake8 arcsecond tests --count --select=E9,F63,F7,F82 --show-source --statistics
- name: Check formatting with black
run: |
black --check arcsecond tests
- name: Check imports with isort
run: |
isort --check-only --profile black arcsecond tests