Bump actions/setup-python from 5 to 6 #42
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: ['*'] # Run on all branches | |
| pull_request: | |
| branches: ['*'] # Run on all PR branches | |
| jobs: | |
| lint: | |
| name: Lint and Type Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.10' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| version: "latest" | |
| - name: Install dependencies | |
| run: | | |
| uv pip install --system -e ".[dev]" | |
| - name: Check code formatting with Black | |
| run: | | |
| black --check --diff . | |
| - name: Lint with Ruff | |
| run: | | |
| ruff check . --output-format=github | |
| - name: Type check with MyPy | |
| run: | | |
| mypy . | |
| test: | |
| name: Test Python ${{ matrix.python-version }} | |
| runs-on: ubuntu-latest | |
| needs: lint # Only run tests if linting passes | |
| strategy: | |
| matrix: | |
| python-version: ['3.10', '3.11', '3.12'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| version: "latest" | |
| - name: Install dependencies | |
| run: | | |
| uv pip install --system -e ".[dev]" | |
| - name: Run unit tests with coverage | |
| run: | | |
| pytest -m "not integration" --cov=mcp_server_odoo --cov-report=xml --cov-report=term | |
| env: | |
| ODOO_URL: ${{ vars.ODOO_URL || 'http://localhost:8069' }} | |
| ODOO_DB: ${{ vars.ODOO_DB || 'test' }} | |
| ODOO_API_KEY: ${{ vars.ODOO_API_KEY || 'test_api_key' }} | |
| ODOO_USER: ${{ vars.ODOO_USER || 'admin' }} | |
| ODOO_PASSWORD: ${{ vars.ODOO_PASSWORD || 'admin' }} | |
| - name: Upload coverage to Codecov | |
| if: matrix.python-version == '3.10' # Only upload once | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| file: ./coverage.xml | |
| flags: unittests | |
| name: codecov-umbrella | |
| fail_ci_if_error: false | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| integration-test: | |
| name: Integration Tests | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| continue-on-error: true # Don't fail the workflow if integration tests fail | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.10' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| version: "latest" | |
| - name: Install dependencies | |
| run: | | |
| uv pip install --system -e ".[dev]" | |
| - name: Run integration tests | |
| run: | | |
| pytest -m "integration" -v | |
| env: | |
| ODOO_URL: ${{ vars.ODOO_URL || 'http://localhost:8069' }} | |
| ODOO_DB: ${{ vars.ODOO_DB || 'test' }} | |
| ODOO_API_KEY: ${{ vars.ODOO_API_KEY || 'test_api_key' }} | |
| ODOO_USER: ${{ vars.ODOO_USER || 'admin' }} | |
| ODOO_PASSWORD: ${{ vars.ODOO_PASSWORD || 'admin' }} | |
| build: | |
| name: Build Package | |
| runs-on: ubuntu-latest | |
| needs: [lint, test] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.10' | |
| - name: Install build tools | |
| run: | | |
| pip install build twine | |
| - name: Build package | |
| run: | | |
| python -m build | |
| - name: Check package | |
| run: | | |
| twine check dist/* | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ |