This commit is contained in:
parent
202e59096b
commit
9cd59a1e20
@ -16,13 +16,41 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.ref_name }}
|
||||
- name: Set up pyenv
|
||||
run: |
|
||||
curl https://pyenv.run | bash
|
||||
export PATH="$HOME/.pyenv/bin:$PATH"
|
||||
eval "$(pyenv init --path)"
|
||||
eval "$(pyenv init -)"
|
||||
eval "$(pyenv virtualenv-init -)"
|
||||
|
||||
- name: Install Python with pyenv
|
||||
run: |
|
||||
export PATH="$HOME/.pyenv/bin:$PATH"
|
||||
eval "$(pyenv init --path)"
|
||||
eval "$(pyenv init -)"
|
||||
eval "$(pyenv virtualenv-init -)"
|
||||
pyenv install ${{ matrix.python }} -s
|
||||
|
||||
- name: Clean up Virtual Environment
|
||||
run: ./setup/clean_up_virtualenvs.sh 0
|
||||
|
||||
|
||||
- name: Create Virtual Environment
|
||||
run: pyenv virtualenv "${{ github.ref_name }}-$(git rev-parse --short "$GITHUB_SHA")"
|
||||
run: |
|
||||
export PATH="$HOME/.pyenv/bin:$PATH"
|
||||
eval "$(pyenv init --path)"
|
||||
eval "$(pyenv init -)"
|
||||
eval "$(pyenv virtualenv-init -)"
|
||||
pyenv virtualenv ${{ matrix.python }} "${{ github.ref_name }}-$(git rev-parse --short "$GITHUB_SHA")"
|
||||
|
||||
- name: Activate Virtual Environment
|
||||
run: pyenv activate "${{ github.ref_name }}-$(git rev-parse --short "$GITHUB_SHA")"
|
||||
run: |
|
||||
export PATH="$HOME/.pyenv/bin:$PATH"
|
||||
eval "$(pyenv init --path)"
|
||||
eval "$(pyenv init -)"
|
||||
eval "$(pyenv virtualenv-init -)"
|
||||
pyenv activate "${{ github.ref_name }}-$(git rev-parse --short "$GITHUB_SHA")"
|
||||
python --version # Confirm Python version
|
||||
|
||||
- name: Install dotenv
|
||||
run: pip install python-dotenv
|
||||
|
@ -20,7 +20,7 @@ if (( keep_count > 0 )); then
|
||||
# Loop through the oldest virtual environments and delete them
|
||||
for venv in $oldest_venvs; do
|
||||
echo "Deleting virtual environment: $venv"
|
||||
pyenv virtualenv-delete "$venv" -f
|
||||
pyenv virtualenv-delete -f "$venv"
|
||||
done
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user