forked from pypa/setuptools
-
Notifications
You must be signed in to change notification settings - Fork 0
138 lines (132 loc) · 3.58 KB
/
python-tests.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: >-
👷
Test suite
on:
push:
pull_request:
schedule:
- cron: 1 0 * * * # Run daily at 0:01 UTC
jobs:
tests:
name: >-
${{ matrix.python-version }}
/
${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
# max-parallel: 5
matrix:
python-version:
- 3.9
- 3.8
- pypy3
- 3.7
- 3.6
os:
- ubuntu-18.04
- ubuntu-16.04
- macOS-latest
# - windows-2019
# - windows-2016
include:
# Dev versions (deadsnakes)
- os: ubuntu-20.04
python-version: 3.9-dev
- os: ubuntu-20.04
python-version: 3.8-dev
env:
NETWORK_REQUIRED: 1
PYTHON_VERSION: ${{ matrix.python-version }}
TOX_PARALLEL_NO_SPINNER: 1
TOXENV: python
USE_DEADSNAKES: false
steps:
- uses: actions/checkout@master
- name: Set flag to use deadsnakes
if: >-
endsWith(env.PYTHON_VERSION, '-beta') ||
endsWith(env.PYTHON_VERSION, '-dev')
# FIXME: replace `set-env` with a newer alternative
# Refs:
# * github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
run: |
from __future__ import print_function
import os
python_version = '${{ env.PYTHON_VERSION }}'.replace('-beta', '')
with open(os.environ['GITHUB_ENV'], 'a') as env_file:
env_file.write('PYTHON_VERSION={ver}\n'.format(ver=python_version))
env_file.write('USE_DEADSNAKES=true\n')
shell: python
- name: Set up Python ${{ env.PYTHON_VERSION }} (deadsnakes)
uses: deadsnakes/action@v2.0.1
if: fromJSON(env.USE_DEADSNAKES) && true || false
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v2
if: >-
!fromJSON(env.USE_DEADSNAKES) && true || false
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Log Python version
run: >-
python --version
- name: Log Python location
run: >-
which python
- name: Log Python env
run: >-
python -m sysconfig
- name: Pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('setup.cfg') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Upgrade pip/setuptools/wheel
run: >-
python
-m pip install
--disable-pip-version-check
--upgrade
pip setuptools wheel
- name: Install tox
run: >-
python -m pip install --upgrade tox tox-venv
- name: Log installed dists
run: >-
python -m pip freeze --all
- name: Adjust TOXENV for PyPy
if: startsWith(env.PYTHON_VERSION, 'pypy')
run: >-
echo "TOXENV=${{ env.PYTHON_VERSION }}"
>>
"${GITHUB_ENV}"
- name: Log env vars
run: >-
env
- name: Verify that there's no cached Python modules in sources
if: >-
! startsWith(matrix.os, 'windows-')
run: >-
! grep pyc setuptools.egg-info/SOURCES.txt
- name: 'Initialize tox envs: ${{ matrix.env.TOXENV }}'
run: >-
python -m
tox
--parallel auto
--parallel-live
--notest
--skip-missing-interpreters false
- name: Test with tox
run: >-
python -m
tox
--parallel auto
--parallel-live
--
-vvvvv