From 5034c2bfb9f2c7ca252047f8d0c848767ca51298 Mon Sep 17 00:00:00 2001 From: Wu Tingfeng Date: Wed, 31 Jan 2024 11:55:18 +0800 Subject: [PATCH] Do not use venv for python 2. --- .github/workflows/ci.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ad856ad..c87f250 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,12 +13,21 @@ jobs: - name: checkout repo content uses: actions/checkout@v4 - - name: Test + - name: Test (Python 2) + if: matrix.python-version == '2.7' run: | - python3 -m venv venv - venv/bin/python3 -m pip install --upgrade pip - venv/bin/python3 -m pip install pytest pytest-cov - venv/bin/python3 -m pytest --cov + python -m pip install --upgrade pip + python -m pip install pytest pytest-cov + python -m pytest --cov + + - name: Test (Python 3) + if: matrix.python-version != '2.7' + run: | + sudo apt-get install python3-venv + python3 -m venv venv + venv/bin/python3 -m pip install --upgrade pip + venv/bin/python3 -m pip install pytest pytest-cov + venv/bin/python3 -m pytest --cov - name: Coveralls if: matrix.python-version == '3.12'