Skip to content

Commit 17b703b

Browse files
committed
Fix #322: Implement GitHub Action
* Add "gh-action" section in tox.ini * Add .github/workflows/python-testing.yml * Use dependent jobs; first start check, then tests jobs * Remove black-formatting.yml * Remove .travis.yml (cherry picked from commit aa58f62)
1 parent 8bc819f commit 17b703b

File tree

3 files changed

+51
-60
lines changed

3 files changed

+51
-60
lines changed
Lines changed: 37 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
1-
name: Black Formatting
1+
---
2+
name: Python
23

3-
on: [pull_request]
4+
on:
5+
push:
6+
branches: [ master ]
7+
pull_request:
8+
branches: [ master ]
49

510
jobs:
6-
build:
11+
check:
712
runs-on: ubuntu-latest
8-
913
steps:
1014
- uses: actions/checkout@v1
1115
- name: Output env variables
1216
run: |
17+
echo "Default branch=${default-branch}"
1318
echo "GITHUB_WORKFLOW=${GITHUB_WORKFLOW}"
1419
echo "GITHUB_ACTION=$GITHUB_ACTION"
1520
echo "GITHUB_ACTIONS=$GITHUB_ACTIONS"
@@ -26,18 +31,36 @@ jobs:
2631
cat $GITHUB_EVENT_PATH
2732
echo "\n"
2833
echo "::debug::---end"
29-
30-
- name: Set up Python 3.7
31-
uses: actions/setup-python@v1
34+
- name: Set up Python ${{ matrix.python-version }}
35+
uses: actions/setup-python@v2
3236
with:
33-
python-version: 3.7
34-
37+
python-version: 3.6
3538
- name: Install dependencies
3639
run: |
37-
python -m pip install --upgrade pip black
40+
python3 -m pip install --upgrade pip
41+
pip install tox tox-gh-actions
42+
- name: Check
43+
run: |
44+
tox -e checks
45+
46+
tests:
47+
needs: check
48+
runs-on: ubuntu-latest
49+
strategy:
50+
max-parallel: 5
51+
matrix:
52+
python-version: [3.6, 3.7, 3.8, 3.9]
3853

39-
- name: Run black
40-
id: black
54+
steps:
55+
- uses: actions/checkout@v1
56+
- name: Set up Python ${{ matrix.python-version }}
57+
uses: actions/setup-python@v2
58+
with:
59+
python-version: ${{ matrix.python-version }}
60+
- name: Install dependencies
61+
run: |
62+
python3 -m pip install --upgrade pip
63+
pip install tox tox-gh-actions
64+
- name: Test with tox
4165
run: |
42-
black --check .
43-
echo "::set-output name=rc::$?"
66+
tox

.travis.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

tox.ini

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
11
[tox]
22
envlist =
3-
flake8
3+
checks
44
py{27,34,35,36,37,38,39}
5-
pypy
5+
isolated_build = True
6+
7+
[gh-actions]
8+
python =
9+
2.7: py27
10+
3.4: py34
11+
3.5: py35
12+
3.6: py36
13+
3.7: py37
14+
3.8: py38
15+
3.9: py39
16+
# 3.10: py310
17+
618

719
[testenv]
820
description = Run test suite for {basepython}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy