| name: ๐งช check |
| on: |
| workflow_dispatch: |
| push: |
| branches: ["main"] |
| pull_request: |
| schedule: |
| - cron: "0 8 * * *" |
| |
| concurrency: |
| group: ${{ github.workflow }}-${{ github.ref }} |
| cancel-in-progress: true |
| |
| jobs: |
| test: |
| name: ๐งช test ${{ matrix.py }} - ${{ matrix.os }} |
| if: github.event_name != 'schedule' || github.repository_owner == 'pypa' |
| runs-on: ${{ matrix.os }} |
| timeout-minutes: 40 |
| permissions: |
| contents: read |
| env: |
| PIP_DISABLE_PIP_VERSION_CHECK: "1" |
| strategy: |
| fail-fast: false |
| matrix: |
| py: |
| - "3.14t" |
| - "3.14" |
| - "3.13t" |
| - "3.13" |
| - "3.12" |
| - "3.11" |
| - "3.10" |
| - "3.9" |
| - pypy-3.11 |
| - pypy-3.10 |
| - pypy-3.9 |
| - graalpy-24.1 |
| - rp |
| os: |
| - ubuntu-24.04 |
| - macos-15 |
| - windows-2025-vs2026 |
| include: |
| - { os: macos-15, py: "brew@3.14" } |
| - { os: macos-15, py: "brew@3.13" } |
| - { os: macos-15, py: "brew@3.12" } |
| - { os: macos-15, py: "brew@3.11" } |
| - { os: macos-15, py: "brew@3.10" } |
| exclude: |
| - { os: windows-2025-vs2026, py: "graalpy-24.1" } |
| - { os: windows-2025-vs2026, py: "pypy-3.10" } |
| - { os: windows-2025-vs2026, py: "pypy-3.9" } |
| steps: |
| - name: ๐ฅ Checkout code |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
| with: |
| fetch-depth: 0 |
| persist-credentials: false |
| - name: ๐ท๏ธ Fetch upstream tags for versioning |
| shell: bash |
| run: | |
| git fetch --force --tags https://github.com/pypa/virtualenv.git |
| - name: ๐ Install uv |
| uses: astral-sh/setup-uv@d31148d669074a8d0a63714ba94f3201e7020bc3 # v8.3.0 |
| with: |
| enable-cache: true |
| cache-dependency-glob: "pyproject.toml" |
| cache-suffix: ${{ matrix.py }} |
| - name: ๐ Setup Python for tox |
| uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 |
| with: |
| python-version: "3.14" |
| - name: ๐ฆ Install tox with this virtualenv |
| shell: bash |
| run: | |
| if [[ "${{ matrix.py }}" == "3.13t" || "${{ matrix.py }}" == "3.14t" || "${{ matrix.py }}" == "rp" ]]; then |
| uv tool install --no-managed-python --python 3.14 "tox>=4.45" --with . |
| else |
| uv tool install --no-managed-python --python 3.14 "tox>=4.45" --with tox-uv --with . |
| fi |
| - name: ๐ Setup Python for test ${{ matrix.py }} |
| uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 |
| if: ${{ !startsWith(matrix.py, 'brew@') && matrix.py != 'rp' }} |
| with: |
| python-version: ${{ matrix.py }} |
| - name: ๐ฆ Setup RustPython |
| if: matrix.py == 'rp' |
| shell: bash |
| env: |
| GH_TOKEN: ${{ github.token }} |
| run: | |
| tag=$(gh release list --repo RustPython/RustPython --limit 1 --json tagName -q '.[0].tagName') |
| if [ "${{ runner.os }}" = "Linux" ]; then |
| asset="rustpython-release-Linux-x86_64-unknown-linux-gnu" |
| elif [ "${{ runner.os }}" = "macOS" ]; then |
| asset="rustpython-release-macOS-aarch64-apple-darwin" |
| elif [ "${{ runner.os }}" = "Windows" ]; then |
| asset="rustpython-release-Windows-x86_64-pc-windows-msvc.exe" |
| fi |
| gh release download "$tag" --repo RustPython/RustPython --pattern "$asset" --dir "$RUNNER_TEMP" |
| if [ "${{ runner.os }}" = "Windows" ]; then |
| cp "$RUNNER_TEMP/$asset" "/c/ProgramData/chocolatey/bin/rustpython.exe" |
| else |
| chmod +x "$RUNNER_TEMP/$asset" |
| sudo mv "$RUNNER_TEMP/$asset" /usr/local/bin/rustpython |
| fi |
| - name: ๐ ๏ธ Install OS dependencies |
| shell: bash |
| env: |
| GH_TOKEN: ${{ github.token }} |
| run: | |
| if [ "${{ runner.os }}" = "Linux" ]; then |
| retry() { |
| local n=1 |
| while ! "$@"; do |
| if [ $n -ge 5 ]; then |
| echo "Command failed after $n attempts: $*" >&2 |
| return 1 |
| fi |
| echo "Attempt $n failed for: $*; retrying in 10s" >&2 |
| n=$((n + 1)) |
| sleep 10 |
| done |
| } |
| retry sudo apt-get install -y software-properties-common |
| retry sudo apt-add-repository ppa:fish-shell/release-4 -y |
| curl -fsSL --retry 5 --retry-all-errors --retry-delay 10 https://apt.fury.io/nushell/gpg.key \ |
| | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/fury-nushell.gpg |
| echo "deb https://apt.fury.io/nushell/ /" | sudo tee /etc/apt/sources.list.d/fury.list |
| retry sudo apt-get update -y |
| retry sudo apt-get install snapd fish csh nushell -y |
| elif [ "${{ runner.os }}" = "macOS" ]; then |
| brew update |
| if [[ "${{ matrix.py }}" == brew@* ]]; then |
| PY=$(echo '${{ matrix.py }}' | cut -c 6-) |
| brew list --versions "python@$PY" >/dev/null 2>&1 || brew install "python@$PY" |
| echo "/usr/local/opt/python@$PY/libexec/bin" >>"${GITHUB_PATH}" |
| fi |
| brew install fish tcsh nushell || brew upgrade fish tcsh nushell |
| elif [ "${{ runner.os }}" = "Windows" ]; then |
| nu_version=$(gh release view --repo nushell/nushell --json tagName -q .tagName) |
| gh release download "$nu_version" --repo nushell/nushell --pattern "*-x86_64-pc-windows-msvc.zip" --dir "$RUNNER_TEMP" |
| 7z x "$RUNNER_TEMP/nu-${nu_version#v}-x86_64-pc-windows-msvc.zip" -o"$RUNNER_TEMP/nushell" -y |
| cp "$RUNNER_TEMP/nushell/nu.exe" "/c/ProgramData/chocolatey/bin/nu.exe" |
| fi |
| - name: ๐งฌ Pick environment to run |
| shell: bash |
| run: | |
| py="${{ matrix.py }}" |
| if [[ "$py" == brew@* ]]; then |
| brew_version="${py#brew@}" |
| echo "UV_PYTHON=/opt/homebrew/bin/python${brew_version}" >> "$GITHUB_ENV" |
| py="$brew_version" |
| fi |
| [[ "$py" == graalpy-* ]] && py="graalpy" |
| echo "TOXENV=$py" >> "$GITHUB_ENV" |
| echo "Set TOXENV=$py" |
| - name: ๐๏ธ Setup test suite |
| run: tox run -vvvv --notest --skip-missing-interpreters false |
| - name: ๐ Run test suite |
| run: tox run --skip-pkg-install |
| timeout-minutes: 30 |
| env: |
| PYTEST_ADDOPTS: "-vv --durations=20" |
| CI_RUN: "yes" |
| DIFF_AGAINST: HEAD |
| check: |
| name: ๐ check ${{ matrix.tox_env }} - ${{ matrix.os }} |
| if: github.event_name != 'schedule' || github.repository_owner == 'pypa' |
| runs-on: ${{ matrix.os }} |
| permissions: |
| contents: read |
| strategy: |
| fail-fast: false |
| matrix: |
| os: |
| - ubuntu-24.04 |
| - windows-2025-vs2026 |
| tox_env: |
| - dev |
| - docs |
| - readme |
| - type |
| - type-3.9 |
| - upgrade |
| - zipapp |
| exclude: |
| - { os: windows-2025-vs2026, tox_env: docs } |
| - { os: windows-2025-vs2026, tox_env: readme } |
| - { os: windows-2025-vs2026, tox_env: type } |
| - { os: windows-2025-vs2026, tox_env: type-3.9 } |
| steps: |
| - name: ?? Checkout code |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
| with: |
| fetch-depth: 0 |
| persist-credentials: false |
| - name: ๐ท๏ธ Fetch upstream tags for versioning |
| shell: bash |
| run: | |
| git fetch --force --tags https://github.com/pypa/virtualenv.git |
| - name: ?? Install uv |
| uses: astral-sh/setup-uv@d31148d669074a8d0a63714ba94f3201e7020bc3 # v8.3.0 |
| with: |
| enable-cache: true |
| cache-dependency-glob: "pyproject.toml" |
| cache-suffix: ${{ matrix.tox_env }} |
| - name: ๐ฆ Install tox |
| run: uv tool install --python-preference only-managed --python 3.14 "tox>=4.45" --with tox-uv |
| - name: ๐๏ธ Setup check suite |
| run: tox run -vv --notest --skip-missing-interpreters false -e ${{ matrix.tox_env }} |
| - name: ๐ Run check for ${{ matrix.tox_env }} |
| run: tox run --skip-pkg-install -e ${{ matrix.tox_env }} |
| env: |
| UPGRADE_ADVISORY: ${{ matrix.tox_env == 'upgrade' && '1' || '' }} |