From ad444caf9dd6efb039ad568281d90a16ead68eb4 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sat, 15 May 2021 09:27:40 -0400 Subject: Bring in some of the good CI changes from #411 --- .github/workflows/lint-python.yaml | 20 ++++++++++++++++++++ .github/workflows/mypy.yaml | 12 ------------ 2 files changed, 20 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/lint-python.yaml delete mode 100644 .github/workflows/mypy.yaml (limited to '.github/workflows') diff --git a/.github/workflows/lint-python.yaml b/.github/workflows/lint-python.yaml new file mode 100644 index 00000000..c6b16467 --- /dev/null +++ b/.github/workflows/lint-python.yaml @@ -0,0 +1,20 @@ +on: [push, pull_request] +name: Lint Python and Find Syntax Errors +jobs: + lint: + runs-on: ubuntu-latest + container: + image: archlinux:latest + steps: + - uses: actions/checkout@v2 + - run: pacman --noconfirm -Syu python python-pip mypy + - run: python -m pip install --upgrade pip + - run: pip install flake8 pytest black-but-with-tabs-instead-of-spaces + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors + flake8 . --count --select=E9,F63,F7 --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: run mypy + run: mypy . --ignore-missing-imports diff --git a/.github/workflows/mypy.yaml b/.github/workflows/mypy.yaml deleted file mode 100644 index 18823a66..00000000 --- a/.github/workflows/mypy.yaml +++ /dev/null @@ -1,12 +0,0 @@ -on: [push, pull_request] -name: Lint Python and Find Syntax Errors -jobs: - lint: - runs-on: ubuntu-latest - container: - image: archlinux:latest - steps: - - uses: actions/checkout@v2 - - run: pacman --noconfirm -Syu python python-pip mypy - - name: run mypy - run: mypy . --ignore-missing-imports \ No newline at end of file -- cgit v1.2.3-70-g09d2 From 843cd6cf0feff3144ec6b9fdf64904ae44e7f43d Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sat, 15 May 2021 09:45:50 -0400 Subject: Update lint-python.yaml --- .github/workflows/lint-python.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.github/workflows') diff --git a/.github/workflows/lint-python.yaml b/.github/workflows/lint-python.yaml index c6b16467..5e7e6c2f 100644 --- a/.github/workflows/lint-python.yaml +++ b/.github/workflows/lint-python.yaml @@ -9,7 +9,7 @@ jobs: - uses: actions/checkout@v2 - run: pacman --noconfirm -Syu python python-pip mypy - run: python -m pip install --upgrade pip - - run: pip install flake8 pytest black-but-with-tabs-instead-of-spaces + - run: pip install flake8 pytest - name: Lint with flake8 run: | # stop the build if there are Python syntax errors -- cgit v1.2.3-70-g09d2 From be94c7d5fe1cc2e34dfa84f83d87a22a234359fd Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sat, 15 May 2021 09:54:08 -0400 Subject: Split into separate jobs --- .github/workflows/lint-python.yaml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/lint-python.yaml b/.github/workflows/lint-python.yaml index 5e7e6c2f..516c7b4f 100644 --- a/.github/workflows/lint-python.yaml +++ b/.github/workflows/lint-python.yaml @@ -1,13 +1,22 @@ on: [push, pull_request] name: Lint Python and Find Syntax Errors jobs: + mypy: + runs-on: ubuntu-latest + container: + image: archlinux:latest + steps: + - uses: actions/checkout@v2 + - run: pacman --noconfirm -Syu python mypy + - name: run mypy + run: mypy . --ignore-missing-imports lint: runs-on: ubuntu-latest container: image: archlinux:latest steps: - uses: actions/checkout@v2 - - run: pacman --noconfirm -Syu python python-pip mypy + - run: pacman --noconfirm -Syu python python-pip - run: python -m pip install --upgrade pip - run: pip install flake8 pytest - name: Lint with flake8 @@ -16,5 +25,3 @@ jobs: flake8 . --count --select=E9,F63,F7 --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: run mypy - run: mypy . --ignore-missing-imports -- cgit v1.2.3-70-g09d2 From 2d5564a7c2f1b7b79c948f9f19a680dea6cb001d Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sat, 15 May 2021 09:57:10 -0400 Subject: Further split out pytest; TODO: add tests. --- .github/workflows/lint-python.yaml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/lint-python.yaml b/.github/workflows/lint-python.yaml index 516c7b4f..6cba4705 100644 --- a/.github/workflows/lint-python.yaml +++ b/.github/workflows/lint-python.yaml @@ -10,7 +10,7 @@ jobs: - run: pacman --noconfirm -Syu python mypy - name: run mypy run: mypy . --ignore-missing-imports - lint: + flake8: runs-on: ubuntu-latest container: image: archlinux:latest @@ -18,10 +18,23 @@ jobs: - uses: actions/checkout@v2 - run: pacman --noconfirm -Syu python python-pip - run: python -m pip install --upgrade pip - - run: pip install flake8 pytest + - run: pip install flake8 - name: Lint with flake8 run: | # stop the build if there are Python syntax errors flake8 . --count --select=E9,F63,F7 --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 + pytest: + runs-on: ubuntu-latest + container: + image: archlinux:latest + steps: + - uses: actions/checkout@v2 + - run: pacman --noconfirm -Syu python python-pip + - run: python -m pip install --upgrade pip + - run: pip install pytest + # TODO: Add tests and enable pytest checks. +# - name: Test with pytest +# run: | +# pytest -- cgit v1.2.3-70-g09d2