[skip-ci] Update actions/setup-python action to v6 #7602
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: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| lint: | |
| name: Lint Code | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install the latest version of uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Install dependencies | |
| shell: bash | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y bash codespell podman | |
| uv run -- make install-requirements | |
| - name: Run format check | |
| run: | | |
| uv run -- make check-format | |
| - name: Run lint | |
| run: | | |
| uv run -- make lint | |
| - name: Run man check | |
| run: | | |
| uv run -- make man-check | |
| - name: Run type checking | |
| run: | | |
| uv run -- make type-check | |
| build-image: | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 60 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install the latest version of uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Install dependencies | |
| shell: bash | |
| run: | | |
| df -h | |
| sudo apt-get update | |
| sudo apt-get install -y bash codespell pipx podman | |
| uv run -- make install-requirements | |
| - name: Upgrade to podman 5 | |
| run: | | |
| set -e | |
| # /mnt has ~ 65 GB free disk space. / is too small. | |
| sudo mkdir -m a=rwx -p /mnt/tmp /mnt/runner | |
| sudo mkdir -m o=rwx -p /home/runner/.local | |
| sudo chown runner:runner /mnt/runner /home/runner/.local | |
| sudo mount --bind /mnt/runner /home/runner/.local | |
| # Enable universe repository which contains podman | |
| sudo add-apt-repository "deb http://old-releases.ubuntu.com/ubuntu oracular universe" | |
| # Update package lists | |
| sudo apt-get update | |
| sudo apt-get purge firefox | |
| # Install specific podman version | |
| sudo apt-get upgrade -y podman crun | |
| - name: Build a container for CPU inferencing | |
| shell: bash | |
| run: | | |
| ./container_build.sh build -s ramalama | |
| unit-test: | |
| name: Unit Tests | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install the latest version of uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Install dependencies | |
| shell: bash | |
| run: | | |
| df -h | |
| sudo apt-get update | |
| sudo apt-get install -y bash codespell pipx podman | |
| uv run -- make install-requirements | |
| - name: Upgrade to podman 5 | |
| run: | | |
| set -e | |
| # Enable universe repository which contains podman | |
| sudo add-apt-repository "deb http://old-releases.ubuntu.com/ubuntu oracular universe" | |
| # Update package lists | |
| sudo apt-get update | |
| sudo apt-get purge firefox | |
| # Install specific podman version | |
| sudo apt-get upgrade -y podman crun | |
| - name: Run unit tests | |
| run: | | |
| uv run -- make unit-tests | |
| bats: | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 60 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install the latest version of uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: install bats | |
| shell: bash | |
| run: | | |
| df -h | |
| # /mnt has ~ 65 GB free disk space. / is too small. | |
| sudo mkdir -m a=rwx -p /mnt/tmp /mnt/runner | |
| sudo mkdir -m o=rwx -p /home/runner/.local | |
| sudo chown runner:runner /mnt/runner /home/runner/.local | |
| sudo mount --bind /mnt/runner /home/runner/.local | |
| sudo apt-get update | |
| sudo apt-get install podman bats bash codespell | |
| uv run -- make install-requirements | |
| - name: install ollama | |
| shell: bash | |
| run: ./.github/scripts/install-ollama.sh | |
| - name: Upgrade to podman 5 | |
| run: | | |
| set -e | |
| # Enable universe repository which contains podman | |
| sudo add-apt-repository "deb http://old-releases.ubuntu.com/ubuntu oracular universe" | |
| # Update package lists | |
| sudo apt-get update | |
| sudo apt-get purge firefox | |
| # Install specific podman version | |
| sudo apt-get upgrade -y podman crun | |
| - name: run bats | |
| run: | | |
| TEMPDIR=/mnt/tmp | |
| uv run -- make bats | |
| bats-nocontainer: | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 60 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install the latest version of uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: install bats | |
| shell: bash | |
| run: | | |
| df -h | |
| sudo apt-get update | |
| sudo apt-get install podman bats bash codespell git cmake libcurl4-openssl-dev | |
| sudo ./container-images/scripts/build_llama_and_whisper.sh | |
| uv run -- make install-requirements | |
| - name: install ollama | |
| shell: bash | |
| run: ./.github/scripts/install-ollama.sh | |
| - name: Upgrade to podman 5 | |
| run: | | |
| set -e | |
| # Enable universe repository which contains podman | |
| sudo add-apt-repository "deb http://old-releases.ubuntu.com/ubuntu oracular universe" | |
| # Update package lists | |
| sudo apt-get update | |
| sudo apt-get purge firefox | |
| # Install specific podman version | |
| sudo apt-get upgrade -y podman crun | |
| - name: run bats-nocontainer | |
| run: | | |
| uv run -- make bats-nocontainer | |
| docker: | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 60 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install the latest version of uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: install bats | |
| shell: bash | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install bats bash codespell | |
| uv run -- make install-requirements | |
| - name: install ollama | |
| shell: bash | |
| run: ./.github/scripts/install-ollama.sh | |
| - name: Upgrade to podman 5 | |
| run: | | |
| set -e | |
| # Enable universe repository which contains podman | |
| sudo add-apt-repository "deb http://old-releases.ubuntu.com/ubuntu oracular universe" | |
| # Update package lists | |
| sudo apt-get update | |
| sudo apt-get purge firefox | |
| # Install specific podman version | |
| sudo apt-get upgrade -y podman crun | |
| - name: Free Disk Space Linux | |
| shell: bash | |
| run: | | |
| sudo docker rmi "$(docker image ls -aq)" >/dev/null 2>&1 || true | |
| sudo rm -rf \ | |
| /usr/share/dotnet /usr/local/lib/android /opt/ghc \ | |
| /usr/local/share/powershell /usr/share/swift /usr/local/.ghcup \ | |
| /usr/lib/jvm || true | |
| # /mnt has ~ 65 GB free disk space. / is too small. | |
| - name: Reconfigure Docker data-root | |
| run: | | |
| sudo mkdir -p /mnt/docker /etc/docker | |
| echo '{"data-root": "/mnt/docker"}' > /tmp/daemon.json | |
| sudo mv /tmp/daemon.json /etc/docker/daemon.json | |
| cat /etc/docker/daemon.json | |
| sudo systemctl restart docker.service | |
| sudo mkdir -m a=rwx -p /mnt/tmp /mnt/runner | |
| sudo mkdir -m o=rwx -p /home/runner/.local | |
| sudo chown runner:runner /mnt/runner /home/runner/.local | |
| sudo mount --bind /mnt/runner /home/runner/.local | |
| df -h | |
| - name: run bats-docker | |
| run: | | |
| docker info | |
| uv run -- make bats-docker | |
| macos: | |
| runs-on: macos-15 | |
| timeout-minutes: 60 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install the latest version of uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: '<3.14' | |
| - name: install mlx-lm | |
| shell: bash | |
| run: | | |
| uv tool install mlx-lm | |
| - name: install golang | |
| shell: bash | |
| run: | | |
| brew install go bats bash jq llama.cpp shellcheck | |
| uv run -- make install-requirements | |
| - name: install ollama | |
| shell: bash | |
| run: ./.github/scripts/install-ollama.sh | |
| - name: run bats | |
| shell: bash | |
| run: | | |
| uv run -- make bats-nocontainer | |
| e2e-tests: | |
| name: E2E Tests | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 60 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install the latest version of uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| activate-environment: true | |
| - name: install requirements | |
| shell: bash | |
| run: | | |
| df -h | |
| # /mnt has ~ 65 GB free disk space. / is too small. | |
| sudo mkdir -m a=rwx -p /mnt/runner | |
| sudo mkdir -m o=rwx -p /home/runner/.local | |
| sudo chown runner:runner /mnt/runner /home/runner/.local | |
| sudo mount --bind /mnt/runner /home/runner/.local | |
| sudo apt-get update | |
| sudo apt-get install podman bash codespell | |
| uv tool install tox --with tox-uv | |
| uv pip install ".[dev]" | |
| - name: install ollama | |
| shell: bash | |
| run: ./.github/scripts/install-ollama.sh | |
| - name: Upgrade to podman 5 | |
| run: | | |
| set -e | |
| # Enable universe repository which contains podman | |
| sudo add-apt-repository "deb http://old-releases.ubuntu.com/ubuntu oracular universe" | |
| # Update package lists | |
| sudo apt-get update | |
| sudo apt-get purge firefox | |
| # Install specific podman version | |
| sudo apt-get upgrade -y podman crun | |
| - name: run e2e-tests | |
| run: | | |
| make e2e-tests | |
| e2e-tests-nocontainer: | |
| name: E2E Tests (--no-container) | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 60 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install the latest version of uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| activate-environment: true | |
| - name: install requirements | |
| shell: bash | |
| run: | | |
| df -h | |
| sudo apt-get update | |
| sudo apt-get install podman bash codespell git cmake libcurl4-openssl-dev | |
| sudo ./container-images/scripts/build_llama_and_whisper.sh | |
| uv tool install tox --with tox-uv | |
| uv pip install ".[dev]" | |
| - name: install ollama | |
| shell: bash | |
| run: ./.github/scripts/install-ollama.sh | |
| - name: Upgrade to podman 5 | |
| run: | | |
| set -e | |
| # Enable universe repository which contains podman | |
| sudo add-apt-repository "deb http://old-releases.ubuntu.com/ubuntu oracular universe" | |
| # Update package lists | |
| sudo apt-get update | |
| sudo apt-get purge firefox | |
| # Install specific podman version | |
| sudo apt-get upgrade -y podman crun | |
| - name: run e2e-tests-nocontainer | |
| run: | | |
| make e2e-tests-nocontainer | |
| e2e-tests-docker: | |
| name: E2E Tests (docker) | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 60 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install the latest version of uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| activate-environment: true | |
| - name: install requirements | |
| shell: bash | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install bash codespell | |
| uv tool install tox --with tox-uv | |
| uv pip install ".[dev]" | |
| - name: install ollama | |
| shell: bash | |
| run: ./.github/scripts/install-ollama.sh | |
| - name: Upgrade to podman 5 | |
| run: | | |
| set -e | |
| # Enable universe repository which contains podman | |
| sudo add-apt-repository "deb http://old-releases.ubuntu.com/ubuntu oracular universe" | |
| # Update package lists | |
| sudo apt-get update | |
| sudo apt-get purge firefox | |
| # Install specific podman version | |
| sudo apt-get upgrade -y podman crun | |
| - name: Free Disk Space Linux | |
| shell: bash | |
| run: | | |
| sudo docker rmi "$(docker image ls -aq)" >/dev/null 2>&1 || true | |
| sudo rm -rf \ | |
| /usr/share/dotnet /usr/local/lib/android /opt/ghc \ | |
| /usr/local/share/powershell /usr/share/swift /usr/local/.ghcup \ | |
| /usr/lib/jvm || true | |
| # /mnt has ~ 65 GB free disk space. / is too small. | |
| - name: Reconfigure Docker data-root | |
| run: | | |
| sudo mkdir -p /mnt/docker /etc/docker | |
| echo '{"data-root": "/mnt/docker"}' > /tmp/daemon.json | |
| sudo mv /tmp/daemon.json /etc/docker/daemon.json | |
| cat /etc/docker/daemon.json | |
| sudo systemctl restart docker.service | |
| sudo mkdir -m a=rwx -p /mnt/tmp /mnt/runner | |
| sudo mkdir -m o=rwx -p /home/runner/.local | |
| sudo chown runner:runner /mnt/runner /home/runner/.local | |
| sudo mount --bind /mnt/runner /home/runner/.local | |
| df -h | |
| - name: run e2e-tests-docker | |
| run: | | |
| docker info | |
| make e2e-tests-docker | |
| e2e-tests-macos: | |
| name: E2E Tests (macos) | |
| runs-on: macos-15 | |
| timeout-minutes: 60 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install the latest version of uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| activate-environment: true | |
| python-version: '<3.14' | |
| - name: install mlx-lm | |
| shell: bash | |
| run: | | |
| uv pip install mlx-lm | |
| - name: install requirements | |
| shell: bash | |
| run: | | |
| brew install go bash jq llama.cpp shellcheck podman | |
| uv tool install tox --with tox-uv | |
| uv run -- make install-requirements | |
| - name: install ollama | |
| shell: bash | |
| run: ./.github/scripts/install-ollama.sh | |
| - name: run e2e-tests-nocontainer | |
| shell: bash | |
| run: | | |
| make e2e-tests-nocontainer | |
| e2e-tests-windows: | |
| name: E2E Tests (Windows with Podman) | |
| runs-on: windows-latest | |
| timeout-minutes: 90 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.11' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| - name: Update WSL2 | |
| shell: pwsh | |
| run: | | |
| Write-Host "Updating WSL2..." | |
| wsl --update | |
| wsl --shutdown | |
| - name: Install Podman | |
| shell: pwsh | |
| run: | | |
| Write-Host "Installing Podman on Windows..." | |
| # Download and install Podman | |
| $podmanVersion = "5.7.0" | |
| $installerUrl = "https://github.com/containers/podman/releases/download/v$podmanVersion/podman-$podmanVersion-setup.exe" | |
| $installerPath = "$env:TEMP\podman-setup.exe" | |
| Write-Host "Downloading Podman v$podmanVersion..." | |
| Invoke-WebRequest -Uri $installerUrl -OutFile $installerPath | |
| Write-Host "Installing Podman..." | |
| Start-Process -FilePath $installerPath -ArgumentList "/install", "/quiet", "/norestart" -Wait -NoNewWindow | |
| # Add Podman to PATH for current session | |
| $podmanPath = "$env:ProgramFiles" + "\RedHat\Podman" | |
| $env:PATH = "$podmanPath;$env:PATH" | |
| [Environment]::SetEnvironmentVariable("PATH", $env:PATH, [EnvironmentVariableTarget]::Process) | |
| # Update PATH for future steps | |
| Add-Content -Path $env:GITHUB_PATH -Value "$podmanPath" | |
| Write-Host "Verifying Podman installation..." | |
| podman --version | |
| Write-Host "Initializing Podman machine..." | |
| podman machine init --now --rootful | |
| # Wait for Podman to be ready | |
| $maxAttempts = 30 | |
| $attempt = 0 | |
| while ($attempt -lt $maxAttempts) { | |
| try { | |
| podman info | Out-Null | |
| Write-Host "Podman is ready!" | |
| break | |
| } | |
| catch { | |
| $attempt++ | |
| Write-Host "Waiting for Podman to be ready (attempt $attempt/$maxAttempts)..." | |
| Start-Sleep -Seconds 2 | |
| } | |
| } | |
| if ($attempt -eq $maxAttempts) { | |
| Write-Error "Podman failed to start" | |
| exit 1 | |
| } | |
| Write-Host "Podman info:" | |
| podman info | |
| - name: Install Python dependencies | |
| shell: pwsh | |
| run: | | |
| Write-Host "Installing Python dependencies..." | |
| uv pip install --system ".[dev]" | |
| uv tool install tox --with tox-uv | |
| - name: Run E2E tests | |
| shell: pwsh | |
| env: | |
| RAMALAMA_CONTAINER_ENGINE: podman | |
| run: | | |
| Write-Host "Running E2E tests..." | |
| # Add uv tools to PATH | |
| $uvToolsPath = "$env:USERPROFILE\.local\bin" | |
| $env:PATH = "$uvToolsPath;$env:PATH" | |
| # Run tests | |
| tox -e e2e -- --container-engine=podman -v | |
| - name: Debug - Show Podman logs on failure | |
| if: failure() | |
| shell: pwsh | |
| run: | | |
| Write-Host "=== Podman Machine List ===" | |
| podman machine list | |
| Write-Host "`n=== Podman System Connection List ===" | |
| podman system connection list | |
| Write-Host "`n=== Podman Info ===" | |
| podman info || true | |
| Write-Host "`n=== Podman Version ===" | |
| podman version || true | |
| Write-Host "`n=== Running Containers ===" | |
| podman ps -a || true | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-e2e-test-results | |
| path: | | |
| test-results/ | |
| *.log | |
| retention-days: 7 | |
| # FIXME: ci script should be able to run on MAC. | |
| # - name: Run ci | |
| # shell: bash | |
| # run: make ci |