From 2a70e47363a079d7ec95bcf195940c4a5d539c11 Mon Sep 17 00:00:00 2001 From: PSala Date: Wed, 6 Mar 2024 09:01:55 +0100 Subject: [PATCH] Update test ci python setup --- .github/workflows/python-app.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index d627f5a..9a57b81 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -18,14 +18,25 @@ jobs: # For example, pypy2 and pypy3 fail-fast: false matrix: - python-version: ["2.7.18", "3.11.1"] + python-version: ["2.7", "3.11"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} + if: matrix.python-version == '3.11' uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + - name: Install Python 2 + if: matrix.python-version == '2.7' + run: | + sudo apt update + sudo apt install python2 python-pip + sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 1 + sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 2 + printf '1\n' | sudo update-alternatives --config python + cd /usr/bin + sudo ln -s /usr/bin/pip2 ./pip - name: Install dependencies run: | if [ -f requirements.txt ]; then pip install -r requirements.txt; fi