You've already forked setup-python
							
							
				mirror of
				https://github.com/actions/setup-python.git
				synced 2025-11-04 16:56:40 +07:00 
			
		
		
		
	* Add pip-install input * Improve error message * Logic update --------- Co-authored-by: “gowridurgad” <“hgowridurgad@github.com>
		
			
				
	
	
		
			367 lines
		
	
	
		
			10 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			367 lines
		
	
	
		
			10 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
name: e2e-cache
 | 
						|
 | 
						|
on:
 | 
						|
  pull_request:
 | 
						|
    paths-ignore:
 | 
						|
      - '**.md'
 | 
						|
  push:
 | 
						|
    branches:
 | 
						|
      - main
 | 
						|
      - releases/*
 | 
						|
    paths-ignore:
 | 
						|
      - '**.md'
 | 
						|
  workflow_dispatch:
 | 
						|
 | 
						|
permissions:
 | 
						|
  contents: read
 | 
						|
jobs:
 | 
						|
  python-pip-dependencies-caching:
 | 
						|
    name: Test pip (Python ${{ matrix.python-version}}, ${{ matrix.os }})
 | 
						|
    runs-on: ${{ matrix.os }}
 | 
						|
    strategy:
 | 
						|
      fail-fast: false
 | 
						|
      matrix:
 | 
						|
        os:
 | 
						|
          [
 | 
						|
            ubuntu-latest,
 | 
						|
            ubuntu-24.04-arm,
 | 
						|
            ubuntu-22.04,
 | 
						|
            ubuntu-22.04-arm,
 | 
						|
            windows-latest,
 | 
						|
            macos-latest,
 | 
						|
            macos-13
 | 
						|
          ]
 | 
						|
        python-version:
 | 
						|
          [
 | 
						|
            '3.9',
 | 
						|
            'pypy-3.9-v7.x',
 | 
						|
            '3.10',
 | 
						|
            'pypy-3.10-v7.x',
 | 
						|
            '3.11',
 | 
						|
            'pypy-3.11-v7.x',
 | 
						|
            '3.12',
 | 
						|
            '3.13'
 | 
						|
          ]
 | 
						|
        exclude:
 | 
						|
          - os: windows-latest
 | 
						|
            python-version: pypy-3.11-v7.x
 | 
						|
          - os: macos-latest
 | 
						|
            python-version: pypy-3.9-v7.x
 | 
						|
 | 
						|
    steps:
 | 
						|
      - uses: actions/checkout@v5
 | 
						|
      - name: Setup Python
 | 
						|
        uses: ./
 | 
						|
        with:
 | 
						|
          python-version: ${{ matrix.python-version }}
 | 
						|
          cache: 'pip'
 | 
						|
      - name: Install dependencies
 | 
						|
        run: pip install numpy pandas requests
 | 
						|
 | 
						|
  python-pipenv-dependencies-caching:
 | 
						|
    name: Test pipenv (Python ${{ matrix.python-version}}, ${{ matrix.os }})
 | 
						|
    runs-on: ${{ matrix.os }}
 | 
						|
    strategy:
 | 
						|
      fail-fast: false
 | 
						|
      matrix:
 | 
						|
        os:
 | 
						|
          [
 | 
						|
            ubuntu-latest,
 | 
						|
            ubuntu-24.04-arm,
 | 
						|
            ubuntu-22.04,
 | 
						|
            ubuntu-22.04-arm,
 | 
						|
            windows-latest,
 | 
						|
            macos-latest,
 | 
						|
            macos-13
 | 
						|
          ]
 | 
						|
        python-version:
 | 
						|
          ['3.10', 'pypy-3.10-v7.x', '3.11', 'pypy-3.11-v7.x', '3.12', '3.13']
 | 
						|
        exclude:
 | 
						|
          - os: windows-latest
 | 
						|
            python-version: pypy-3.11-v7.x
 | 
						|
          - os: ubuntu-22.04
 | 
						|
            python-version: pypy-3.11-v7.x
 | 
						|
          - os: ubuntu-22.04-arm
 | 
						|
            python-version: pypy-3.10-v7.x
 | 
						|
          - os: ubuntu-22.04-arm
 | 
						|
            python-version: pypy-3.11-v7.x
 | 
						|
          - os: ubuntu-22.04-arm
 | 
						|
            python-version: pypy-3.10-v7.x
 | 
						|
    steps:
 | 
						|
      - uses: actions/checkout@v5
 | 
						|
      - name: Setup Python
 | 
						|
        id: cache-pipenv
 | 
						|
        uses: ./
 | 
						|
        with:
 | 
						|
          python-version: ${{ matrix.python-version }}
 | 
						|
          cache: 'pipenv'
 | 
						|
      - name: Install pipenv
 | 
						|
        run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python
 | 
						|
      - name: Prepare environment
 | 
						|
        shell: pwsh
 | 
						|
        run: |
 | 
						|
          mv ./__tests__/data/Pipfile.lock .
 | 
						|
          mv ./__tests__/data/Pipfile .
 | 
						|
          mv ./__tests__/test-pipenv.py .
 | 
						|
      - name: Install dependencies
 | 
						|
        shell: pwsh
 | 
						|
        if: steps.cache-pipenv.outputs.cache-hit != 'true'
 | 
						|
        run: |
 | 
						|
          if ("${{ matrix.python-version }}" -Match "pypy") {
 | 
						|
            pipenv install --python pypy # --keep-outdated
 | 
						|
          } else {
 | 
						|
            pipenv install --python ${{ matrix.python-version }} # --keep-outdated
 | 
						|
          }
 | 
						|
      - name: Run Python Script
 | 
						|
        run: pipenv run python test-pipenv.py
 | 
						|
 | 
						|
  python-poetry-dependencies-caching:
 | 
						|
    name: Test poetry (Python ${{ matrix.python-version}}, ${{ matrix.os }})
 | 
						|
    runs-on: ${{ matrix.os }}
 | 
						|
    strategy:
 | 
						|
      fail-fast: false
 | 
						|
      matrix:
 | 
						|
        os:
 | 
						|
          [
 | 
						|
            ubuntu-latest,
 | 
						|
            ubuntu-24.04-arm,
 | 
						|
            ubuntu-22.04,
 | 
						|
            ubuntu-22.04-arm,
 | 
						|
            windows-latest,
 | 
						|
            macos-latest,
 | 
						|
            macos-13
 | 
						|
          ]
 | 
						|
        python-version:
 | 
						|
          [
 | 
						|
            '3.9',
 | 
						|
            'pypy-3.9-v7.x',
 | 
						|
            '3.10',
 | 
						|
            'pypy-3.10-v7.x',
 | 
						|
            '3.11',
 | 
						|
            'pypy-3.11-v7.x',
 | 
						|
            '3.12',
 | 
						|
            '3.13'
 | 
						|
          ]
 | 
						|
    steps:
 | 
						|
      - uses: actions/checkout@v5
 | 
						|
      - name: Install poetry
 | 
						|
        run: pipx install poetry
 | 
						|
      - name: Init pyproject.toml
 | 
						|
        run: mv ./__tests__/data/pyproject.toml .
 | 
						|
      - name: Setup Python
 | 
						|
        uses: ./
 | 
						|
        with:
 | 
						|
          python-version: ${{ matrix.python-version }}
 | 
						|
          cache: 'poetry'
 | 
						|
      - name: Install dependencies
 | 
						|
        run: poetry install --no-root
 | 
						|
 | 
						|
  python-pip-dependencies-caching-path:
 | 
						|
    name: Test pip (Python ${{ matrix.python-version}}, ${{ matrix.os }}, caching path)
 | 
						|
    runs-on: ${{ matrix.os }}
 | 
						|
    strategy:
 | 
						|
      fail-fast: false
 | 
						|
      matrix:
 | 
						|
        os:
 | 
						|
          [
 | 
						|
            ubuntu-latest,
 | 
						|
            ubuntu-24.04-arm,
 | 
						|
            ubuntu-22.04,
 | 
						|
            ubuntu-22.04-arm,
 | 
						|
            windows-latest,
 | 
						|
            macos-latest,
 | 
						|
            macos-13
 | 
						|
          ]
 | 
						|
        python-version:
 | 
						|
          [
 | 
						|
            '3.9',
 | 
						|
            'pypy-3.9-v7.x',
 | 
						|
            '3.10',
 | 
						|
            'pypy-3.10-v7.x',
 | 
						|
            '3.11',
 | 
						|
            'pypy-3.11-v7.x',
 | 
						|
            '3.12',
 | 
						|
            '3.13'
 | 
						|
          ]
 | 
						|
        exclude:
 | 
						|
          - os: windows-latest
 | 
						|
            python-version: pypy-3.11-v7.x
 | 
						|
          - os: macos-latest
 | 
						|
            python-version: pypy-3.9-v7.x
 | 
						|
    steps:
 | 
						|
      - uses: actions/checkout@v5
 | 
						|
      - name: Setup Python
 | 
						|
        uses: ./
 | 
						|
        with:
 | 
						|
          python-version: ${{ matrix.python-version }}
 | 
						|
          cache: 'pip'
 | 
						|
          cache-dependency-path: __tests__/data/requirements.txt
 | 
						|
      - name: Install dependencies
 | 
						|
        run: pip install numpy pandas requests
 | 
						|
 | 
						|
  python-pipenv-dependencies-caching-path:
 | 
						|
    name: Test pipenv (Python ${{ matrix.python-version}}, ${{ matrix.os }}, caching path)
 | 
						|
    runs-on: ${{ matrix.os }}
 | 
						|
    strategy:
 | 
						|
      fail-fast: false
 | 
						|
      matrix:
 | 
						|
        os:
 | 
						|
          [
 | 
						|
            ubuntu-latest,
 | 
						|
            ubuntu-24.04-arm,
 | 
						|
            ubuntu-22.04,
 | 
						|
            ubuntu-22.04-arm,
 | 
						|
            windows-latest,
 | 
						|
            macos-latest,
 | 
						|
            macos-13
 | 
						|
          ]
 | 
						|
        python-version:
 | 
						|
          ['3.10', 'pypy-3.10-v7.x', '3.11', 'pypy-3.11-v7.x', '3.12', '3.13']
 | 
						|
        exclude:
 | 
						|
          - os: windows-latest
 | 
						|
            python-version: pypy-3.11-v7.x
 | 
						|
          - os: ubuntu-22.04
 | 
						|
            python-version: pypy-3.11-v7.x
 | 
						|
          - os: ubuntu-22.04-arm
 | 
						|
            python-version: pypy-3.10-v7.x
 | 
						|
          - os: ubuntu-22.04-arm
 | 
						|
            python-version: pypy-3.11-v7.x
 | 
						|
    steps:
 | 
						|
      - uses: actions/checkout@v5
 | 
						|
      - name: Setup Python
 | 
						|
        id: cache-pipenv
 | 
						|
        uses: ./
 | 
						|
        with:
 | 
						|
          python-version: ${{ matrix.python-version }}
 | 
						|
          cache: 'pipenv'
 | 
						|
          cache-dependency-path: '**/pipenv-requirements.txt'
 | 
						|
      - name: Install pipenv
 | 
						|
        run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python
 | 
						|
      - name: Prepare environment
 | 
						|
        shell: pwsh
 | 
						|
        run: |
 | 
						|
          mv ./__tests__/data/Pipfile.lock .
 | 
						|
          mv ./__tests__/data/Pipfile .
 | 
						|
          mv ./__tests__/test-pipenv.py .
 | 
						|
      - name: Install dependencies
 | 
						|
        shell: pwsh
 | 
						|
        if: steps.cache-pipenv.outputs.cache-hit != 'true'
 | 
						|
        run: |
 | 
						|
          if ("${{ matrix.python-version }}" -Match "pypy") {
 | 
						|
            pipenv install --python pypy # --keep-outdated
 | 
						|
          } else {
 | 
						|
            pipenv install --python ${{ matrix.python-version }} # --keep-outdated
 | 
						|
          }
 | 
						|
      - name: Run Python Script
 | 
						|
        run: pipenv run python test-pipenv.py
 | 
						|
 | 
						|
  python-pip-dependencies-caching-with-pip-version:
 | 
						|
    name: Test pip (Python ${{ matrix.python-version}}, ${{ matrix.os }})
 | 
						|
    runs-on: ${{ matrix.os }}
 | 
						|
    strategy:
 | 
						|
      fail-fast: false
 | 
						|
      matrix:
 | 
						|
        os:
 | 
						|
          [
 | 
						|
            ubuntu-latest,
 | 
						|
            ubuntu-24.04-arm,
 | 
						|
            ubuntu-22.04,
 | 
						|
            ubuntu-22.04-arm,
 | 
						|
            windows-latest,
 | 
						|
            macos-latest,
 | 
						|
            macos-13
 | 
						|
          ]
 | 
						|
        python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
 | 
						|
    steps:
 | 
						|
      - uses: actions/checkout@v5
 | 
						|
      - name: Setup Python
 | 
						|
        uses: ./
 | 
						|
        with:
 | 
						|
          python-version: ${{ matrix.python-version }}
 | 
						|
          cache: 'pip'
 | 
						|
          pip-version: '25.0.1'
 | 
						|
      - name: Install dependencies
 | 
						|
        run: pip install numpy pandas requests
 | 
						|
 | 
						|
  python-pip-dependencies-caching-path-with-pip-version:
 | 
						|
    name: Test pip (Python ${{ matrix.python-version}}, ${{ matrix.os }}, caching path)
 | 
						|
    runs-on: ${{ matrix.os }}
 | 
						|
    strategy:
 | 
						|
      fail-fast: false
 | 
						|
      matrix:
 | 
						|
        os:
 | 
						|
          [
 | 
						|
            ubuntu-latest,
 | 
						|
            ubuntu-24.04-arm,
 | 
						|
            ubuntu-22.04,
 | 
						|
            ubuntu-22.04-arm,
 | 
						|
            windows-latest,
 | 
						|
            macos-latest,
 | 
						|
            macos-13
 | 
						|
          ]
 | 
						|
        python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
 | 
						|
    steps:
 | 
						|
      - uses: actions/checkout@v5
 | 
						|
      - name: Setup Python
 | 
						|
        uses: ./
 | 
						|
        with:
 | 
						|
          python-version: ${{ matrix.python-version }}
 | 
						|
          cache: 'pip'
 | 
						|
          cache-dependency-path: __tests__/data/requirements.txt
 | 
						|
          pip-version: '25.0.1'
 | 
						|
      - name: Install dependencies
 | 
						|
        run: pip install numpy pandas requests
 | 
						|
 | 
						|
  python-pip-dependencies-caching-with-pip-install:
 | 
						|
    name: Test pip (Python ${{ matrix.python-version}}, ${{ matrix.os }})
 | 
						|
    runs-on: ${{ matrix.os }}
 | 
						|
    strategy:
 | 
						|
      fail-fast: false
 | 
						|
      matrix:
 | 
						|
        os:
 | 
						|
          [
 | 
						|
            ubuntu-latest,
 | 
						|
            ubuntu-24.04-arm,
 | 
						|
            ubuntu-22.04,
 | 
						|
            ubuntu-22.04-arm,
 | 
						|
            windows-latest,
 | 
						|
            macos-latest,
 | 
						|
            macos-13
 | 
						|
          ]
 | 
						|
        python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
 | 
						|
    steps:
 | 
						|
      - uses: actions/checkout@v5
 | 
						|
      - name: Setup Python
 | 
						|
        uses: ./
 | 
						|
        with:
 | 
						|
          python-version: ${{ matrix.python-version }}
 | 
						|
          cache: 'pip'
 | 
						|
          pip-install: numpy pandas requests
 | 
						|
 | 
						|
  python-pip-dependencies-caching-path-with-pip-install:
 | 
						|
    name: Test pip (Python ${{ matrix.python-version}}, ${{ matrix.os }}, caching path)
 | 
						|
    runs-on: ${{ matrix.os }}
 | 
						|
    strategy:
 | 
						|
      fail-fast: false
 | 
						|
      matrix:
 | 
						|
        os:
 | 
						|
          [
 | 
						|
            ubuntu-latest,
 | 
						|
            ubuntu-24.04-arm,
 | 
						|
            ubuntu-22.04,
 | 
						|
            ubuntu-22.04-arm,
 | 
						|
            windows-latest,
 | 
						|
            macos-latest,
 | 
						|
            macos-13
 | 
						|
          ]
 | 
						|
        python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
 | 
						|
    steps:
 | 
						|
      - uses: actions/checkout@v5
 | 
						|
      - name: Setup Python
 | 
						|
        uses: ./
 | 
						|
        with:
 | 
						|
          python-version: ${{ matrix.python-version }}
 | 
						|
          cache: 'pip'
 | 
						|
          cache-dependency-path: __tests__/data/requirements.txt
 | 
						|
          pip-install: numpy pandas requests
 |