Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pyenv GitHub Action #428

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 40 additions & 40 deletions .github/workflows/installation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,44 +9,44 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Output Python version
id: python-version
run: |
echo "::set-output name=python-version::$(cat .python-version)"
- name: Cache pyenv versions
uses: actions/[email protected]
id: cached-pyenvs
with:
path: /opt/hostedtoolcache/pyenv_root
key: ${{ runner.os }}-pyenv
- name: Install pyenv versions
uses: gabrielfalcao/pyenv-action@v9
with:
default: ${{ steps.python-version.outputs.python-version }}
# if: steps.cached-pyenvs.outputs.cache-hit != 'true'
- name: Install Poetry
run: |
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
source $HOME/.poetry/env
pyenv install -s
poetry config virtualenvs.in-project true
poetry env info
poetry env use `cat .python-version`
- name: Cache dependencies
uses: actions/[email protected]
id: cached-poetry-dependencies
with:
path: .venv
key: venv-${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: |
source $HOME/.poetry/env
poetry install
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
- name: Run tests
run: |
source $HOME/.poetry/env
poetry run pytest
- name: Output Python version
id: python-version
run: |
echo "::set-output name=python-version::$(cat .python-version)"
- name: Cache pyenv versions
uses: actions/[email protected]
id: cached-pyenvs
with:
path: /opt/hostedtoolcache/pyenv_root
key: ${{ runner.os }}-pyenv
- name: Install pyenv versions
uses: gabrielfalcao/pyenv-action@v9
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with:
default: ${{ steps.python-version.outputs.python-version }}
# if: steps.cached-pyenvs.outputs.cache-hit != 'true'
- name: Install Poetry
run: |
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
source $HOME/.poetry/env
pyenv install -s
poetry config virtualenvs.in-project true
poetry env info
poetry env use `cat .python-version`
- name: Cache dependencies
uses: actions/[email protected]
id: cached-poetry-dependencies
with:
path: .venv
key: venv-${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: |
source $HOME/.poetry/env
poetry install
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
- name: Run tests
run: |
source $HOME/.poetry/env
poetry run pytest