-
Notifications
You must be signed in to change notification settings - Fork 42
105 lines (103 loc) · 3.2 KB
/
main.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: CI
on: [push, pull_request]
jobs:
build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
name: [
Python 3.9 (Windows),
Python 3.9 (Macintosh),
Python 3.9 (Ubuntu),
Python 3.8 (Windows),
Python 3.8 (Macintosh),
Python 3.8 (Ubuntu),
Python 3.7 (Windows),
Python 3.7 (Macintosh),
Python 3.7 (Ubuntu),
]
include:
- name: Python 3.9 (Windows)
os: windows-latest
python-version: 3.9
- name: Python 3.9 (Macintosh)
os: macOS-10.15
python-version: 3.9
- name: Python 3.9 (Ubuntu)
os: ubuntu-latest
python-version: 3.9
- name: Python 3.8 (Windows)
os: windows-latest
python-version: 3.8
- name: Python 3.8 (Macintosh)
os: macos-latest
python-version: 3.8
- name: Python 3.8 (Ubuntu)
os: ubuntu-latest
python-version: 3.8
- name: Python 3.7 (Windows)
os: windows-latest
python-version: 3.7
- name: Python 3.7 (Macintosh)
os: macos-latest
python-version: 3.7
- name: Python 3.7 (Ubuntu)
os: ubuntu-latest
python-version: 3.7
env:
VENV_DIR: env
steps:
- name: Checkout repository
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: "Caching (for Linux)"
uses: actions/cache@v1
if: startsWith(runner.os, 'linux')
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: ${{ runner.os }}-pip-
- name: "Caching (for Macintosh)"
uses: actions/cache@v1
if: startsWith(runner.os, 'macos')
with:
path: ~/Library/Caches/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: ${{ runner.os }}-pip-
- name: "Caching (for Windows)"
uses: actions/cache@v1
if: startsWith(runner.os, 'windows')
with:
path: ~\AppData\Local\pip\Cache
key: v2-${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: ${{ runner.os }}-pip-
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Initialize environment
shell: bash
run: python -m venv "${VENV_DIR}"
- name: Install packages
shell: bash
run: |
case "${{ matrix.os }}" in
windows*) scripts="Scripts";;
* ) scripts="bin";;
esac
. "${VENV_DIR}/${scripts}/activate"
python -m pip install --upgrade pip
python -m pip install --default-timeout=1000 -r requirements.txt
- name: Run tests
shell: bash
run: |
case "${{ matrix.os }}" in
windows*) scripts="Scripts";;
* ) scripts="bin";;
esac
. "${VENV_DIR}/${scripts}/activate"
echo "Using $(python --version) on ${{ matrix.os }}" 1>&2
nosetests --traverse-namespace --with-coverage tests