Merge pull request #13 from devanshkv/codex/make-tool-runnable-with-uvx #32
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: Python package | ||
| on: [push, pull_request] | ||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| max-parallel: 4 | ||
| matrix: | ||
| python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] # Updated to versions compatible with uv | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| - name: Install uv | ||
| run: curl -LsSf https://astral.sh/uv/install.sh | sh | ||
| shell: bash | ||
| - name: Install dependencies | ||
| run: | | ||
| source $HOME/.cargo/env # Ensure uv is in PATH for subsequent steps | ||
| uv pip install --system -r requirements.txt | ||
| uv pip install --system pytest pytest-cov # For running tests | ||
| - name: Install package | ||
| run: | | ||
| source $HOME/.cargo/env | ||
| uv pip install --system . | ||
| - name: Lint with black | ||
| run: | | ||
| source $HOME/.cargo/env | ||
| uv run black --check . | ||
| - name: Run pytest and Generate coverage report | ||
| run: | | ||
| source $HOME/.cargo/env | ||
| uv run pytest --cov=argmark --cov-report=xml | ||
| - name: Upload coverage to Codecov | ||
| uses: codecov/codecov-action@v5 | ||
| with: | ||
| token: ${{ secrets.CODECOV_TOKEN }} | ||
| file: ./coverage.xml | ||
| name: codecov-umbrella # Optional: can be removed if not specifically needed | ||
| fail_ci_if_error: true | ||
| env: # Ensure environment variables are available if action needs them | ||
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
| ``` | ||