Fixed and optimized github workflows #303
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: Coverage | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
code-coverage: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.13"] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Debug file and directory state | |
run: | | |
echo "Debugging file and directory state..." | |
ls -la | |
echo "Environment state..." | |
env | |
echo "Git status..." | |
git status | |
- name: Install the latest version of uv | |
uses: astral-sh/setup-uv@v3 | |
with: | |
version: "latest" | |
- name: Print the installed uv version | |
run: echo "Installed uv version is ${{ steps.setup-uv.outputs.uv-version }}" | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies with uv | |
run: | | |
uv venv .venv | |
uv sync | |
- name: Create coverage directory | |
run: mkdir -p coverage | |
- name: Run tests with coverage | |
run: | | |
uv run pytest --cov=src.samplics --cov-report=xml:coverage/coverage.xml --cov-report=term -v tests | |
- name: Verify coverage report exists | |
run: | | |
ls -lh coverage/coverage.xml || echo "⚠️ Warning: coverage.xml not found!" | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./coverage/coverage.xml | |
flags: unittests | |
env_vars: OS,PYTHON | |
name: codecov-umbrella | |
fail_ci_if_error: true | |
verbose: true |