Skip to content

Commit

Permalink
adding pytest workflow (#65)
Browse files Browse the repository at this point in the history
* adding pytest workflow

Signed-off-by: Deepak Raj <54245038+codePerfectPlus@users.noreply.github.com>

* fixing bug in action

Signed-off-by: Deepak Raj <54245038+codePerfectPlus@users.noreply.github.com>
  • Loading branch information
codeperfectplus committed Oct 29, 2022
1 parent e27c683 commit 9c958ab
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 25 deletions.
1 change: 0 additions & 1 deletion .github/workflows/add_labels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
17 changes: 0 additions & 17 deletions .github/workflows/python-app.yml

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/run-pytest.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 9c958ab

Please sign in to comment.