diff --git a/.gitea/workflows/setup_docker.yml b/.gitea/workflows/setup_docker.yml index 5d8ea17eb..f43f85f87 100644 --- a/.gitea/workflows/setup_docker.yml +++ b/.gitea/workflows/setup_docker.yml @@ -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 diff --git a/setup/clean_up_virtualenvs.sh b/setup/clean_up_virtualenvs.sh index 0224b8465..f383c2fb3 100755 --- a/setup/clean_up_virtualenvs.sh +++ b/setup/clean_up_virtualenvs.sh @@ -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