From ab54e72cbc2deea270859ee32420e1123bc3d8d3 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Thu, 30 Jun 2022 12:35:09 +0530 Subject: [PATCH] ci(patch): Switch Python env for each version --- .github/workflows/patch-mariadb-tests.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/patch-mariadb-tests.yml b/.github/workflows/patch-mariadb-tests.yml index cebbc25712..765d83dd4f 100644 --- a/.github/workflows/patch-mariadb-tests.yml +++ b/.github/workflows/patch-mariadb-tests.yml @@ -31,9 +31,10 @@ jobs: uses: actions/checkout@v3 - name: Setup Python - uses: actions/setup-python@v4 + uses: "gabrielfalcao/pyenv-action@v9" with: - python-version: '3.10' + versions: 3.10:latest, 3.7:latest, 2.7:latest + command: pyenv local 3.10 - name: Setup Node uses: actions/setup-node@v3 @@ -120,15 +121,23 @@ jobs: for version in $(seq 12 13) do echo "Updating to v$version" + if [ $version == 12 ]; then + pyenv local 2.7 + elif [ $version == 13 ]; then + pyenv local 3.7 + fi branch_name="version-$version-hotfix" git fetch --depth 1 upstream $branch_name:$branch_name - git checkout -q -f $branch_name - bench setup requirements --python + + rm -rf ~/frappe-bench/env + bench setup env bench --site test_site migrate done echo "Updating to last commit" git checkout -q -f "$GITHUB_SHA" - bench setup requirements --python + pyenv local 3.10 + rm -rf ~/frappe-bench/env + bench setup env bench --site test_site migrate