From 54e758eb3230ec0e664c912398c50b634dfce568 Mon Sep 17 00:00:00 2001 From: Jeremy Frank Date: Wed, 3 Apr 2024 17:46:45 -0600 Subject: [PATCH] add pytest and flake8 workflow --- .github/workflows/python-app.yml | 31 +++++++++++++++++++++++++++++++ requirements.txt | 2 +- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/python-app.yml diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml new file mode 100644 index 0000000..19a6600 --- /dev/null +++ b/.github/workflows/python-app.yml @@ -0,0 +1,31 @@ +name: Python application test + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.x + uses: actions/setup-python@v1 + with: + python-version: '3.x' + - 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: | + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + pytest diff --git a/requirements.txt b/requirements.txt index da4f556..9eaeb85 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ cryptography==42.0.5 substrate-interface==1.7.7 pyasn1==0.6.0 -python-dotenv=1.0.1 +python-dotenv==1.0.1 wheel==0.43.0 \ No newline at end of file