From 8e41a343cad9a1c589a6b481e823d0c778c0ee30 Mon Sep 17 00:00:00 2001 From: Aleksey Ostapenko Date: Tue, 1 Oct 2019 00:54:03 +0300 Subject: [PATCH 1/3] try github workflows --- .github/workflows/pythonpackage.yml | 34 +++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/pythonpackage.yml diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml new file mode 100644 index 000000000..bc2f6416f --- /dev/null +++ b/.github/workflows/pythonpackage.yml @@ -0,0 +1,34 @@ +name: Python package + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + max-parallel: 4 + matrix: + python-version: [2.7, 3.5, 3.6, 3.7] + + steps: + - uses: actions/checkout@v1 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + - name: Lint with flake8 + run: | + pip install flake8 + # 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 pytest + run: | + pip install pytest + pytest From a09debfff2905a07f0653dc4360ee21b0e771763 Mon Sep 17 00:00:00 2001 From: Aleksey Ostapenko Date: Tue, 1 Oct 2019 01:58:43 +0300 Subject: [PATCH 2/3] use tayfun/flake8-your-pr@1.0.1 action --- .github/workflows/pythonpackage.yml | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index bc2f6416f..ce19b10e1 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -1,15 +1,19 @@ name: Python package -on: [push] +on: + push: + paths: + - '**.py' jobs: - build: + lint_and_test: runs-on: ubuntu-latest + timeout-minutes: 10 strategy: max-parallel: 4 matrix: - python-version: [2.7, 3.5, 3.6, 3.7] + python-version: [3.7] steps: - uses: actions/checkout@v1 @@ -17,17 +21,8 @@ jobs: uses: actions/setup-python@v1 with: python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - name: Lint with flake8 - run: | - pip install flake8 - # 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 + uses: tayfun/flake8-your-pr@1.0.1 - name: Test with pytest run: | pip install pytest From 5610ab7177fc6c2ddd12dd745098d0701884cb0b Mon Sep 17 00:00:00 2001 From: Aleksey Ostapenko Date: Tue, 1 Oct 2019 02:08:53 +0300 Subject: [PATCH 3/3] Update pythonpackage.yml --- .github/workflows/pythonpackage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index ce19b10e1..9e152f581 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -22,7 +22,7 @@ jobs: with: python-version: ${{ matrix.python-version }} - name: Lint with flake8 - uses: tayfun/flake8-your-pr@1.0.1 + uses: tayfun/flake8-your-pr@1.0.1 - name: Test with pytest run: | pip install pytest