Updated for ruff #9
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] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.12", "3.13"] | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| version: "0.5.6" | |
| enable-cache: true | |
| - name: Set up Python ${{ matrix.python-version }} | |
| run: uv python install ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: uv sync --group dev | |
| - name: Check formatting with ruff | |
| run: uv run ruff format --check . | |
| - name: Lint with ruff | |
| run: uv run ruff check fastworker tests | |
| - name: Run tests | |
| run: uv run pytest --ignore=tests/test_discovery.py --ignore=tests/integration_test.py -v | |
| check-version: | |
| needs: [test] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - name: Check version and create tag | |
| run: | | |
| CURRENT_VERSION=$(grep -oP 'version = "\K[^"]+' pyproject.toml) | |
| PREV_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "none") | |
| if [ "$PREV_TAG" != "v$CURRENT_VERSION" ]; then | |
| git tag "v$CURRENT_VERSION" | |
| git push origin "v$CURRENT_VERSION" | |
| fi |