Skip to content

Commit

Permalink
change ci to miniconda for old python compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
lihsai0 committed Jul 27, 2023
1 parent 99a3c6f commit a0ec65e
Showing 1 changed file with 28 additions and 16 deletions.
44 changes: 28 additions & 16 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,48 @@ jobs:
fail-fast: false
max-parallel: 1
matrix:
python_version: ['2.7', '3.4.10', '3.5', '3.6', '3.7', '3.8', '3.9']
python_version: ['2.7', '3.4', '3.5', '3.6', '3.7', '3.8', '3.9']
runs-on: ubuntu-20.04
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
- name: Setup python
if: ${{ matrix.python_version != '3.4.10' }}
uses: actions/setup-python@v2
- name: Setup miniconda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
channels: conda-forge
python-version: ${{ matrix.python_version }}
architecture: x64
- name: Setup python manually
if: ${{ matrix.python_version == '3.4.10' }}
activate-environment: qiniu-sdk
auto-activate-base: false
- name: Setup pip
shell: bash -l {0}
env:
PYTHON_SOURCE_URL: https://www.python.org/ftp/python/${{ matrix.python_version }}/Python-${{ matrix.python_version }}.tgz
PYTHON_VERSION: ${{ matrix.python_version }}
PIP_BOOTSTRAP_SCRIPT_PREFIX: https://bootstrap.pypa.io/pip
run: |
cd /tmp
curl -s -L "$PYTHON_SOURCE_URL" | tar -zxf - -C ./
cd Python-${{ matrix.python_version }}
./configure --enable-optimizations
make
sudo make install
echo 'export PATH="/opt/python/bin:$PATH"' >> $HOME/.bashrc
MAJOR=$(echo "$VERSION" | cut -d'.' -f1)
MINOR=$(echo "$VERSION" | cut -d'.' -f2)
# certifi too old for requests in python 3.4
if [[ $MAJOR_MINOR -eq "3.4" ]]; then
conda remove -y certifi
fi
# reinstall pip by some python(<3.7) not compatible
if ! [[ $MAJOR -ge 3 && $MINOR -ge 7 ]]; then
cd /tmp
wget -qLO get-pip.py "$PIP_BOOTSTRAP_SCRIPT_PREFIX/$MAJOR.MINOR/get-pip.py"
python get-pip.py --user
fi
- name: Install dependencies
shell: bash -l {0}
run: |
python -m pip install --upgrade pip
pip install "coverage<7.2" flake8 pytest pytest-cov freezegun requests scrutinizer-ocular codecov
python -m pip install "coverage<7.2" flake8 pytest pytest-cov freezegun requests scrutinizer-ocular codecov
- name: Run cases
shell: bash -l {0}
env:
QINIU_ACCESS_KEY: ${{ secrets.QINIU_ACCESS_KEY }}
QINIU_SECRET_KEY: ${{ secrets.QINIU_SECRET_KEY }}
Expand Down

0 comments on commit a0ec65e

Please sign in to comment.