diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6a9267b..7ac8775 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,7 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements.txt - pip install pytest pytest-cov pytest-xdist pytest-timeout + pip install pytest pytest-xdist pytest-timeout - name: Check Python version run: | @@ -43,6 +43,46 @@ jobs: python -c "import sys; print(f'Python {sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}')" - name: Run tests with pytest + run: | + pytest tests/ -v --tb=short + continue-on-error: false + + coverage: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.13'] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + allow-prereleases: true + + - name: Cache pip packages + uses: actions/cache@v4 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install pytest pytest-cov pytest-xdist pytest-timeout + + - name: Check Python version + run: | + python --version + python -c "import sys; print(f'Python {sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}')" + + - name: Run tests with coverage run: | pytest tests/ -v --cov=vnc_lib --cov-report=xml --cov-report=html --cov-report=term-missing --tb=short continue-on-error: false @@ -124,7 +164,7 @@ jobs: build: runs-on: ubuntu-latest - needs: [test, lint] + needs: [test, coverage, lint] steps: - name: Checkout code uses: actions/checkout@v4 @@ -152,7 +192,7 @@ jobs: coverage-report: runs-on: ubuntu-latest - needs: test + needs: coverage steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/pytest.ini b/pytest.ini index 37b93d7..4ea02b4 100644 --- a/pytest.ini +++ b/pytest.ini @@ -12,11 +12,6 @@ addopts = -v --strict-markers --tb=short - --cov=vnc_lib - --cov-report=term-missing - --cov-report=html - --cov-report=xml - --cov-fail-under=65 # Coverage options [coverage:run]