docs: update .github/workflows/ci.yml via Apex Optimizer #1
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 | |
| # Trigger the workflow on push events for the main branch and on pull requests | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: | |
| - "3.10" | |
| - "3.11" | |
| - "3.12" | |
| - "3.13" | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: "uv" | |
| - name: Install uv | |
| run: pip install uv --index-url https://pypi.org/simple/ | |
| - name: Install Dependencies with uv | |
| run: | | |
| uv pip install -r requirements.txt | |
| uv pip install -r requirements-dev.txt # Assuming a dev requirements file for testing/linting | |
| - name: Lint with Ruff | |
| run: | | |
| uv run --tool ruff check . --fix # Use uv run to ensure Ruff is activated in its environment | |
| - name: Format with Ruff | |
| run: | | |
| uv run --tool ruff format . --fix # Use uv run to ensure Ruff is activated in its environment | |
| - name: Test with Pytest | |
| run: | | |
| uv run --tool pytest # Use uv run to ensure Pytest is activated in its environment | |
| # Example for Code Coverage - requires setup for tools like Codecov or Coveralls | |
| # - name: Upload Coverage to Codecov | |
| # uses: codecov/codecov-action@v4 | |
| # with: | |
| # token: ${{ secrets.CODECOV_TOKEN }} | |
| # file: ./coverage.xml | |
| # fail_ci_if_error: true |