Cicd combined #1
Workflow file for this run
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
| # SPDX-License-Identifier: Apache-2.0 | |
| name: CI | |
| on: | |
| pull_request: | |
| branches: [main] | |
| push: | |
| branches: [main] | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| # ruff isn't a project dependency; fetch the pinned version standalone | |
| # (matches the pre-commit hook). No project sync needed just to lint. | |
| - name: Check formatting | |
| run: uvx ruff@0.9.0 format --check . | |
| - name: Check linting | |
| run: uvx ruff@0.9.0 check . | |
| test-cpu: | |
| name: CPU Tests (Python ${{ matrix.python-version }}) | |
| needs: lint | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.11", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| python-version: ${{ matrix.python-version }} | |
| - run: uv sync --frozen --group dev --extra hf --extra compose | |
| - name: Run CPU tests | |
| run: | | |
| uv run pytest tests/unit/ tests/composer/ tests/hf/ \ | |
| -v -s --tb=short -x \ | |
| --cov=granite_switch --cov-report=xml | |
| - name: Upload coverage | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: coverage.xml | |
| fail_ci_if_error: false |