-
Notifications
You must be signed in to change notification settings - Fork 262
58 lines (58 loc) · 1.94 KB
/
ci-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
on: [push]
name: Run Test Cases
jobs:
test:
strategy:
fail-fast: false
max-parallel: 1
matrix:
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 miniconda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
channels: conda-forge
python-version: ${{ matrix.python_version }}
activate-environment: qiniu-sdk
auto-activate-base: false
- name: Setup pip
shell: bash -l {0}
env:
PYTHON_VERSION: ${{ matrix.python_version }}
PIP_BOOTSTRAP_SCRIPT_PREFIX: https://bootstrap.pypa.io/pip
run: |
MAJOR=$(echo "$PYTHON_VERSION" | cut -d'.' -f1)
MINOR=$(echo "$PYTHON_VERSION" | cut -d'.' -f2)
# 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
python -m pip install -I -e ".[dev]"
- name: Run cases
shell: bash -l {0}
env:
QINIU_ACCESS_KEY: ${{ secrets.QINIU_ACCESS_KEY }}
QINIU_SECRET_KEY: ${{ secrets.QINIU_SECRET_KEY }}
QINIU_TEST_BUCKET: ${{ secrets.QINIU_TEST_BUCKET }}
QINIU_TEST_DOMAIN: ${{ secrets.QINIU_TEST_DOMAIN }}
QINIU_TEST_ENV: "travis"
PYTHONPATH: "$PYTHONPATH:."
run: |
set -e
flake8 --show-source --max-line-length=160 .
py.test --cov qiniu
ocular --data-file .coverage
coverage run test_qiniu.py
codecov