fix: resolve pixi environment configuration warnings #215
This file contains hidden or 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: Quality Metrics & Coverage | |
| on: | |
| push: | |
| branches: [main, development] | |
| pull_request: | |
| branches: [main, development] | |
| jobs: | |
| test-and-coverage: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| env: | |
| PYTHON_VERSION: "3.12" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup pixi with retry mechanism | |
| uses: prefix-dev/[email protected] | |
| with: | |
| pixi-version: v0.50.2 | |
| cache: true | |
| cache-write: ${{ github.event_name != 'pull_request' }} | |
| - name: Install system dependencies | |
| run: sudo apt-get update && sudo apt-get install -y git | |
| - name: Install dependencies with retry | |
| run: | | |
| # Retry mechanism for PIXI installation | |
| for i in {1..3}; do | |
| echo "Attempt $i: Installing PIXI environment..." | |
| if pixi install --environment quality; then | |
| echo "✅ PIXI environment installed successfully" | |
| break | |
| else | |
| echo "⚠️ PIXI installation attempt $i failed" | |
| if [ $i -eq 3 ]; then | |
| echo "❌ All PIXI installation attempts failed" | |
| exit 1 | |
| fi | |
| sleep 10 | |
| fi | |
| done | |
| - name: Run tests with coverage (HTML, XML, JSON, Markdown) | |
| run: | | |
| pixi run -e quality test-cov | |
| pixi run -e quality coverage-markdown | |
| - name: Upload coverage artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-reports | |
| path: | | |
| htmlcov/ | |
| coverage.xml | |
| coverage.json | |
| coverage.md | |
| .coverage* | |
| pytest-report.json | |
| pytest-report.html | |
| - name: diff-cover (PR only) | |
| if: github.event_name == 'pull_request' | |
| run: | | |
| git fetch origin main:refs/remotes/origin/main | |
| pixi run -e quality-extended diff-cover coverage.xml --compare-branch=origin/main --fail-under=90 --html-report diffcover.html --markdown-report diffcover.md --json-report diffcover.json | |
| - name: Upload diff-cover artifacts | |
| if: github.event_name == 'pull_request' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: diffcover-reports | |
| path: | | |
| diffcover.html | |
| diffcover.md | |
| diffcover.json | |
| - name: Comment PR with coverage summary | |
| if: github.event_name == 'pull_request' | |
| uses: marocchino/sticky-pull-request-comment@v2 | |
| with: | |
| path: coverage.md | |
| - name: Quality Gate | |
| run: | | |
| pixi run -e quality quality-gate |