Add tech stack badges #19
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: CI | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: | |
| branches: [main, master] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["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 }} | |
| cache: pip | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e .[dev] | |
| - name: Run lint (ruff) | |
| run: ruff check . | |
| - name: Run type check (mypy) | |
| run: mypy src/coding_agent | |
| - name: Run tests with coverage | |
| run: pytest tests/ -v --tb=short --cov=src/coding_agent --cov-report=xml --cov-fail-under=60 | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: ./coverage.xml | |
| - name: Generate coverage badge | |
| if: matrix.python-version == '3.12' | |
| run: | | |
| pip install coverage-badge | |
| coverage-badge -o coverage.svg -f | |
| echo "COVERAGE=$(cat coverage.svg | grep -oP '(?<=<text[^>]*>)[^<]+' | head -1)" >> $GITHUB_ENV | |
| - name: Upload coverage badge | |
| if: matrix.python-version == '3.12' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-badge | |
| path: coverage.svg | |
| test-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.12 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| cache: pip | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e .[dev] | |
| - name: Run tests with coverage | |
| run: pytest tests/ -v --tb=short --cov=src/coding_agent --cov-report=xml --cov-fail-under=60 | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: ./coverage.xml | |
| build: | |
| runs-on: ubuntu-latest | |
| needs: [test, test-windows] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| cache: pip | |
| - name: Install build dependencies | |
| run: pip install build | |
| - name: Build package | |
| run: python -m build | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist/ |