use uv for install and setup of Python when needed (#9) #274
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
| name: CI | |
| on: | |
| workflow_dispatch: # Start a workflow | |
| push: | |
| jobs: | |
| build: | |
| permissions: | |
| contents: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-13, macos-latest] | |
| python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] | |
| runs-on: ${{ matrix.os }} | |
| 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 | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| enable-cache: true | |
| cache-dependency-path: | | |
| pyproject.toml | |
| uv.lock | |
| - name: Check Python and uv | |
| run: | | |
| uv run python -V | |
| uv run python -c "import sys,shutil;print(sys.executable);print(shutil.which('python') or '')" | |
| uv --version | |
| echo $PATH | |
| - name: Install dependencies with uv | |
| run: | | |
| uv sync --dev | |
| - name: Python Lint | |
| run: | | |
| uv run make lint | |
| - name: Integration Tests | |
| run: | | |
| uv run make test | |
| - name: Pack Installer Script | |
| run: | | |
| uv run make pack | |
| - name: Copy Installer Script to Parent Directory | |
| run: | | |
| cp dist/*.py . | |
| shell: bash | |
| - name: Commit changed `get-platformio.py` | |
| if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13' | |
| uses: stefanzweifel/git-auto-commit-action@v5 | |
| with: | |
| commit_message: "Github Action: Updated `get-platformio.py`" | |
| - name: Install PlatformIO Core | |
| run: | | |
| uv run python get-platformio.py | |
| if [ "$RUNNER_OS" == "Windows" ]; then | |
| ~/.platformio/penv/Scripts/pio.exe system info | |
| else | |
| ~/.platformio/penv/bin/pio system info | |
| fi | |
| shell: bash | |
| - name: Verify uv is installed in PlatformIO penv | |
| run: | | |
| if [ "$RUNNER_OS" == "Windows" ]; then | |
| ~/.platformio/penv/Scripts/uv.exe --version | |
| else | |
| ~/.platformio/penv/bin/uv --version | |
| fi | |
| shell: bash |