diff --git a/.github/workflows/add_labels.yaml b/.github/workflows/add_labels.yaml index 209cf13..bfbee6a 100644 --- a/.github/workflows/add_labels.yaml +++ b/.github/workflows/add_labels.yaml @@ -10,7 +10,6 @@ jobs: steps: - uses: actions/checkout@v2 - uses: actions-ecosystem/action-add-labels@v1 - if: ${{ startsWith(github.event.comment.body, '/add-labels') }} with: labels: | ready-for-review diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 265ef0e..cd1e8f2 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -1,15 +1,8 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. name: "CodeQL" - on: push: branches: [main] pull_request: - # The branches below must be a subset of the branches above branches: [main] schedule: - cron: '0 9 * * 5' diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml deleted file mode 100644 index 9b19b6c..0000000 --- a/.github/workflows/python-app.yml +++ /dev/null @@ -1,17 +0,0 @@ -on: [pull_request] - -jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.8' - - name: Install flake8 - run: | - python -m pip install --upgrade pip - pip install flake8 - - name: Lint with flake8 - run: flake8 . --isolated --exclude=.cache,.venv,.svn,CVS,.bzr,.hg,.git,__pycache__,.tox,**/migrations/** --ignore=E203,W503,E501,F401 diff --git a/.github/workflows/run-pytest.yaml b/.github/workflows/run-pytest.yaml new file mode 100644 index 0000000..43d1f37 --- /dev/null +++ b/.github/workflows/run-pytest.yaml @@ -0,0 +1,32 @@ +name: Python package + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.7", "3.8", "3.9", "3.10"] + + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + 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=200 --statistics + - name: Test with pytest + run: | + pytest \ No newline at end of file