From e32e7a269832a0dabf83be4c7c4ece17852f9d5e Mon Sep 17 00:00:00 2001 From: Anurodh Acharya <93026147+anurodhacharya@users.noreply.github.com> Date: Tue, 15 Feb 2022 14:12:26 +0545 Subject: [PATCH 1/3] Create python-app.yml --- .github/workflows/python-app.yml | 40 ++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) 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..b0d0d43 --- /dev/null +++ b/.github/workflows/python-app.yml @@ -0,0 +1,40 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Python application + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.10 + uses: actions/setup-python@v2 + with: + python-version: "3.10" + - 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=127 --statistics + - name: Test with pytest + run: | + pytest app.py + + - name: Bandit Check + uses: jpetrucciani/bandit-check@1.6.2 + From 6b972be79af24f1bacc8648db558cb564a03162d Mon Sep 17 00:00:00 2001 From: Anurodh Acharya <93026147+anurodhacharya@users.noreply.github.com> Date: Tue, 15 Feb 2022 14:27:11 +0545 Subject: [PATCH 2/3] Update python-app.yml --- .github/workflows/python-app.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index b0d0d43..aa081f5 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -31,9 +31,6 @@ jobs: 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: | - pytest app.py - name: Bandit Check uses: jpetrucciani/bandit-check@1.6.2 From ed612fa70e7feb36b7de616d10daa4e0b4c88064 Mon Sep 17 00:00:00 2001 From: Anurodh Acharya <93026147+anurodhacharya@users.noreply.github.com> Date: Tue, 15 Feb 2022 14:33:27 +0545 Subject: [PATCH 3/3] Update python-app.yml --- .github/workflows/python-app.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index aa081f5..23d8783 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -34,4 +34,9 @@ jobs: - name: Bandit Check uses: jpetrucciani/bandit-check@1.6.2 + + - name: Own Commands + run: | + echo "This is ls command" + ls -la