-
Notifications
You must be signed in to change notification settings - Fork 259
52 lines (52 loc) · 1.89 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
on: [push]
name: Run Test Cases
jobs:
test:
strategy:
fail-fast: false
max-parallel: 1
matrix:
python_version: ['2.7.18', '3.4.10', '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 != '2.7.18' && matrix.python_version != '3.4.10' }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python_version }}
architecture: x64
- name: Setup python manually
if: ${{ matrix.python_version == '2.7.18' || matrix.python_version == '3.4.10' }}
env:
PYTHON_SOURCE_URL: https://www.python.org/ftp/python/${{ matrix.python_version }}/Python-${{ matrix.python_version }}.tgz
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
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install "coverage<7.2" flake8 pytest pytest-cov freezegun requests scrutinizer-ocular codecov
- name: Run cases
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