Update README.md #48
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: [master, main, develop] | |
| pull_request: | |
| branches: [master, main] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| name: Lint & Format | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| cache: "pip" | |
| - name: Install lint tools | |
| run: pip install ruff black isort | |
| - name: Run ruff | |
| run: ruff check src/ tests/ examples/ | |
| - name: Run black (check only) | |
| run: black --check --target-version py310 src/ tests/ examples/ | |
| - name: Run isort (check only) | |
| run: isort --check-only src/ tests/ examples/ | |
| test: | |
| name: Tests (Python ${{ matrix.python-version }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12"] | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: "pip" | |
| - name: Install dependencies | |
| run: | | |
| pip install --upgrade pip | |
| pip install -e ".[dev]" | |
| - name: Run tests | |
| run: | | |
| PYTHONPATH=src pytest tests/ -v \ | |
| --timeout=60 \ | |
| --cov=src/codefix_env \ | |
| --cov-report=xml \ | |
| --cov-report=term-missing | |
| - name: Upload coverage | |
| if: matrix.python-version == '3.11' | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| file: coverage.xml | |
| fail_ci_if_error: false | |
| docker: | |
| name: Docker Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build Docker image | |
| run: docker build -f server/Dockerfile -t codefix-env:test . | |
| - name: Test Docker image | |
| run: | | |
| docker run -d --name codefix-test -p 8000:8000 codefix-env:test | |
| sleep 5 | |
| curl --fail http://localhost:8000/health || (docker logs codefix-test && exit 1) | |
| docker stop codefix-test | |
| type-check: | |
| name: Type Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| cache: "pip" | |
| - name: Install | |
| run: pip install -e ".[dev]" | |
| - name: Run mypy | |
| run: mypy src/codefix_env/ --ignore-missing-imports | |
| continue-on-error: true # don't fail CI on type errors yet |