-
-
Notifications
You must be signed in to change notification settings - Fork 6
70 lines (60 loc) · 2.12 KB
/
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
59
60
61
62
63
64
65
66
67
68
69
70
name: Test
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.6", "3.7", "3.8"]
os: [ubuntu-18.04, ubuntu-16.04, macos-latest]
include:
# Include new variables for Codecov
- { codecov-flag: GHA_Ubuntu1804, os: ubuntu-18.04 }
- { codecov-flag: GHA_Ubuntu1604, os: ubuntu-16.04 }
- { codecov-flag: GHA_macOS, os: macos-latest }
# Dev versions
- { python-version: 3.9-dev, os: ubuntu-18.04 }
- { python-version: 3.10-dev, os: ubuntu-18.04 }
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python }} (deadsnakes)
uses: deadsnakes/action@v1.0.0
if: endsWith(matrix.python-version, '-dev')
with:
python-version: ${{ matrix.python-version }}
- name: Set up Python ${{ matrix.python-version }}
if: "!endsWith(matrix.python-version, '-dev')"
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Get pip cache dir
id: pip-cache
run: |
python -m pip install -U "pip>=20.1"
echo "::set-output name=dir::$(pip cache dir)"
- name: pip cache
uses: actions/cache@v1
with:
path: ${{ steps.pip-cache.outputs.dir }}
key:
${{ matrix.os }}-${{ matrix.python-version }}-v2-${{
hashFiles('**/setup.py') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.python-version }}-v2-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade wheel
python -m pip install --upgrade tox
- name: Tox tests
shell: bash
run: |
tox -e py
- name: Upload coverage
if: success()
run: |
curl --retry 8 -s https://codecov.io/bash -o codecov.sh
bash codecov.sh -F ${{ matrix.codecov-flag }}
env:
CODECOV_NAME: ${{ matrix.os }} Python ${{ matrix.python-version }}