Skip to content

Commit

Permalink
Add GitHub action config for CI testing (replace travis) (#98)
Browse files Browse the repository at this point in the history
Add GitHub action config for CI testing

Migrating from Travis
  • Loading branch information
soupytwist authored Dec 8, 2021
1 parent 14a041f commit 921baea
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 8 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/pasta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This workflow will install Python dependencies, run tests and lint all support python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: pasta

on: [ push ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
# TODO: Add 3.4 when possible
python-version: ["2.7", "3.5.10", "3.6.15", "3.7.12", "3.8.12", "3.9.9"]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with setuptools
run: |
python setup.py test
4 changes: 2 additions & 2 deletions pasta/base/annotate_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,8 +505,8 @@ def test_indent_levels(self):
bar('a1'))
bar('x')
""")
t = pasta.parse(src, astlib=astlib)
call_nodes = ast_utils.find_nodes_by_type(t, astlib.Call, astlib=astlib)
t = pasta.parse(src)
call_nodes = ast_utils.find_nodes_by_type(t, _ast.Call)
call_nodes.sort(key=lambda node: node.lineno)
foo, bar_arg, bar = call_nodes

Expand Down
12 changes: 6 additions & 6 deletions testdata/ast/golden/3.9/fstring.out
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@
(13, 6) BinOp prefix=|| suffix=|| indent=||
(15, 5) Constant prefix=|| suffix=|| indent=||
(18, 2) BinOp prefix=|| suffix=|| indent=||
(21, 1) Name a prefix=|| suffix=|| indent=||
(23, 1) Name b prefix=|| suffix=|| indent=||
(25, 1) Name c prefix=|| suffix=|| indent=||
(21, 3) Name a prefix=|| suffix=|| indent=||
(23, 3) Name b prefix=|| suffix=|| indent=||
(25, 3) Name c prefix=|| suffix=|| indent=||
(25, 0) JoinedStr prefix=|| suffix=|| indent=||
(27, 1) Name c prefix=|| suffix=| | indent=||
(27, 3) Name c prefix=|| suffix=| | indent=||
(27, 0) JoinedStr prefix=|| suffix=| | indent=||
(29, 1) Name f prefix=|| suffix=|| indent=||
(29, 3) Name f prefix=|| suffix=|| indent=||
(29, 0) JoinedStr prefix=|| suffix=|| indent=||
(31, 1) Name h prefix=|| suffix=| | indent=||
(31, 3) Name h prefix=|| suffix=| | indent=||
(31, 0) JoinedStr prefix=|| suffix=|| indent=||
(34, 2) Name l prefix=|| suffix=|| indent=||
(33, 0) JoinedStr prefix=|| suffix=| | indent=||
Expand Down

0 comments on commit 921baea

Please sign in to comment.