Skip to content

Commit fd4b135

Browse files
cclaussrvagg
authored andcommitted
test: initial Github Actions with Ubuntu & macOS
Running Python standalone tests on multiple OSes would free up Travis CI for tests of various combinations of Node.js and Python as well as tests on other [CPU architectures](https://docs.travis-ci.com/user/multi-cpu-architectures). __arch: amd64, arm64, ppc64le, s390x__ PR-URL: #1985 Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
1 parent 0607596 commit fd4b135

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.github/workflows/Python_tests.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# TODO: Line 14, enable os: windows-latest
2+
# TODO: Line 15, enable python-version: 3.5
3+
# TODO: Line 36, enable pytest --doctest-modules
4+
5+
name: Python_tests
6+
on: [push, pull_request]
7+
jobs:
8+
Python_tests:
9+
runs-on: ${{ matrix.os }}
10+
strategy:
11+
fail-fast: false
12+
max-parallel: 15
13+
matrix:
14+
os: [macos-latest, ubuntu-latest] # , windows-latest]
15+
python-version: [2.7, 3.6, 3.7, 3.8] # 3.5,
16+
steps:
17+
- uses: actions/checkout@v1
18+
- name: Set up Python ${{ matrix.python-version }}
19+
uses: actions/setup-python@v1
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install flake8 pytest # -r requirements.txt
26+
- name: Lint with flake8
27+
if: matrix.os == 'ubuntu-latest'
28+
run: |
29+
# stop the build if there are Python syntax errors or undefined names
30+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
31+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
32+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
33+
- name: Test with pytest
34+
run: pytest
35+
# - name: Run doctests with pytest
36+
# run: pytest --doctest-modules

0 commit comments

Comments
 (0)