Update python-app.yml #535
This file contains 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: Test Setup Python with Cache | |
on: | |
push: | |
branches: | |
- test-pr-896 | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest, macos-13, ubuntu-22.04 ] | |
python-version: ["3.12.3"] | |
cache: [pip, poetry, pipenv] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
# - name: Set up Poetry | |
# if: matrix.cache == 'poetry' | |
# run: | | |
# curl -sSL https://install.python-poetry.org | python3 - | |
# echo "$HOME/.local/bin" >> $GITHUB_PATH | |
- name: Install poetry | |
if: matrix.cache == 'poetry' | |
run: pipx install poetry | |
- name: Setup Python | |
uses: priyagupta108/[email protected] | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: ${{ matrix.cache }} | |
- name: Cache dependencies with pip | |
if: matrix.cache == 'pip' | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: poetry install | |
if: matrix.cache == 'poetry' | |
run: | | |
poetry install --no-root | |
- name: Cache dependencies with Pipenv | |
if: matrix.cache == 'pipenv' | |
run: | | |
pip install --upgrade pip | |
pip install pipenv | |
pipenv install |