Skip to content

Commit 2d8197a

Browse files
authored
Merge pull request #323 from tomschr/feature/322-gh-action
Fix #322: Implement GitHub Action
2 parents 608ce3c + aa58f62 commit 2d8197a

File tree

4 files changed

+48
-71
lines changed

4 files changed

+48
-71
lines changed
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 & 53 deletions
This file was deleted.

changelog.d/322.trivial.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Switch from Travis CI to GitHub Actions.

tox.ini

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
[tox]
22
envlist =
3-
flake8
4-
py{36,37,38,39,310}
5-
docs
6-
mypy
3+
checks
4+
py{36,37,38,39}
75
isolated_build = True
86

7+
[gh-actions]
8+
python =
9+
3.6: py36
10+
3.7: py37
11+
3.8: py38
12+
3.9: py39
13+
# 3.10: py310
14+
915

1016
[testenv]
1117
description = Run test suite for {basepython}

0 commit comments

Comments
 (0)