From 3e8e2028955a03943c35cc22286aef8ff98fc904 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Mon, 30 Oct 2023 21:05:49 -0400 Subject: [PATCH] fix(macos): use pyenv to install python --- .github/workflows/ci.yml | 1 + action.yml | 14 +++++--------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f43ae20..880e7c5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,6 +21,7 @@ jobs: os: - macos-11 - macos-12 + - macos-13 - windows-2019 - windows-2022 - ubuntu-20.04 diff --git a/action.yml b/action.yml index c2c2c00..9bd2649 100644 --- a/action.yml +++ b/action.yml @@ -44,15 +44,8 @@ runs: shell: bash if: ${{ inputs.python-version == '2.7' && runner.os == 'macOS' }} run: | - python_version=$(python --version 2>&1) - echo "Python version: ${python_version}" - - if [[ "${python_version}" == *"Python 2.7"* ]]; then - echo "${python_version} already installed, nothing to do" - else - echo "Python 2.7 not installed" - exit 1 - fi + brew install pyenv + pyenv install 2.7.18 - name: Setup Python Environment if: ${{ inputs.python-version == '2.7' }} @@ -76,6 +69,9 @@ runs: venv_base_path="/tmp/python27/venv" venv_dir="bin" elif [[ "${{ runner.os }}" == "macOS" ]]; then + export PATH="$(pyenv root)/shims:${PATH}" + # pyenv init + pyenv shell 2.7.18 venv_base_path="/tmp/python27/venv" venv_dir="bin" fi