1
0
Fork 0
mirror of https://github.com/actions/setup-python.git synced 2024-11-24 17:38:52 +00:00
setup-python/.github/workflows/e2e-cache.yml

149 lines
4.6 KiB
YAML
Raw Normal View History

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, windows-latest, macos-latest]
python-version: ['3.9', 'pypy-3.9-v7.x']
steps:
2023-11-08 10:16:06 +00:00
- uses: actions/checkout@v4
- 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, windows-latest, macos-latest]
2022-06-29 21:41:39 +00:00
python-version: ['3.9', 'pypy-3.9-v7.x']
steps:
2023-11-08 10:16:06 +00:00
- uses: actions/checkout@v4
- name: Setup Python
2023-07-13 12:11:40 +00:00
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
2023-07-13 12:11:40 +00:00
- name: Prepare environment
2022-06-29 18:16:07 +00:00
shell: pwsh
run: |
mv ./__tests__/data/Pipfile.lock .
mv ./__tests__/data/Pipfile .
2023-07-13 12:11:40 +00:00
mv ./__tests__/test-pipenv.py .
- name: Install dependencies
shell: pwsh
if: steps.cache-pipenv.outputs.cache-hit != 'true'
run: |
2022-06-29 18:28:20 +00:00
if ("${{ matrix.python-version }}" -Match "pypy") {
2023-07-13 12:11:40 +00:00
pipenv install --python pypy # --keep-outdated
2022-06-29 18:38:02 +00:00
} else {
2023-07-13 12:11:40 +00:00
pipenv install --python ${{ matrix.python-version }} # --keep-outdated
2022-06-29 18:16:07 +00:00
}
2023-07-13 12:11:40 +00:00
- 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, windows-latest, macos-latest]
python-version: ['3.9', 'pypy-3.9']
steps:
2023-11-08 10:16:06 +00:00
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
2022-07-25 13:02:06 +00:00
- 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
2022-07-25 13:02:06 +00:00
run: poetry install
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, windows-latest, macos-latest]
python-version: ['3.9', 'pypy-3.9-v7.x']
steps:
2023-11-08 10:16:06 +00:00
- uses: actions/checkout@v4
- 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, windows-latest, macos-latest]
2022-06-29 21:41:39 +00:00
python-version: ['3.9', 'pypy-3.9-v7.x']
steps:
2023-11-08 10:16:06 +00:00
- uses: actions/checkout@v4
- name: Setup Python
2023-07-13 12:11:40 +00:00
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
2023-07-13 12:11:40 +00:00
- name: Prepare environment
2022-06-29 18:16:07 +00:00
shell: pwsh
run: |
mv ./__tests__/data/Pipfile.lock .
mv ./__tests__/data/Pipfile .
2023-07-13 12:11:40 +00:00
mv ./__tests__/test-pipenv.py .
- name: Install dependencies
shell: pwsh
if: steps.cache-pipenv.outputs.cache-hit != 'true'
run: |
2022-06-29 18:28:20 +00:00
if ("${{ matrix.python-version }}" -Match "pypy") {
2023-07-13 12:11:40 +00:00
pipenv install --python pypy # --keep-outdated
2022-06-29 18:38:02 +00:00
} else {
2023-07-13 12:11:40 +00:00
pipenv install --python ${{ matrix.python-version }} # --keep-outdated
}
2023-07-13 12:11:40 +00:00
- name: Run Python Script
run: pipenv run python test-pipenv.py