Fix gh actions use of Python version (#13) #19
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: Remove Homebrew Python (macOS) | |
| if: runner.os == 'macOS' | |
| run: | | |
| # Liste alle installierten Python-Versionen von Homebrew auf | |
| brew list --formula | grep '^python@' | while read formula; do | |
| echo "Uninstalling $formula" | |
| brew uninstall --ignore-dependencies --force "$formula" | |
| done | |
| # Entferne auch unversioniertes python falls vorhanden | |
| if brew list python &>/dev/null; then | |
| brew uninstall --ignore-dependencies --force python | |
| fi | |
| # Entferne Symlinks in /usr/local/bin | |
| sudo rm -f /usr/local/bin/python* /usr/local/bin/pip* /usr/local/bin/2to3* | |
| shell: bash | |
| - 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-glob: | | |
| pyproject.toml | |
| uv.lock | |
| - name: Pin Python version for uv | |
| run: uv python pin ${{ matrix.python-version }} | |
| - 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 |