From 45e07725ecd67a28c9c654b6d825e994d5754c13 Mon Sep 17 00:00:00 2001 From: SiriChandanaGarimella <156231102+SiriChandanaGarimella@users.noreply.github.com> Date: Mon, 22 Apr 2024 13:06:55 -0500 Subject: [PATCH 1/3] Update python-test.yml --- .github/workflows/python-app1.yml | 32 +++++++++++-------------------- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/.github/workflows/python-app1.yml b/.github/workflows/python-app1.yml index ab40012d..fe2ce83c 100644 --- a/.github/workflows/python-app1.yml +++ b/.github/workflows/python-app1.yml @@ -3,38 +3,28 @@ name: Python application -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -permissions: - contents: read +on: push jobs: - build: +pytest: runs-on: ubuntu-latest - + strategy: + matrix: + python-version: ["3.10"] steps: - uses: actions/checkout@v3 - - name: Set up Python 3.10 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v3 with: - python-version: "3.10" + python-version: ${{ matrix.python-version }} + - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 pytest + pip install 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: | - export PYTHONPATH=src - pytest + cd Backend && coverage run -m pytest -v -s From 8ed2c5ff75a7c0726000f8536774556bda56ba4f Mon Sep 17 00:00:00 2001 From: SiriChandanaGarimella <156231102+SiriChandanaGarimella@users.noreply.github.com> Date: Mon, 22 Apr 2024 14:25:19 -0500 Subject: [PATCH 2/3] Update indentation --- .github/workflows/python-app1.yml | 45 +++++++++++++++---------------- 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/.github/workflows/python-app1.yml b/.github/workflows/python-app1.yml index fe2ce83c..655128f5 100644 --- a/.github/workflows/python-app1.yml +++ b/.github/workflows/python-app1.yml @@ -2,29 +2,26 @@ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python name: Python application - on: push - jobs: - -pytest: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.10"] - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install pytest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - - name: Test with pytest - run: | - cd Backend && coverage run -m pytest -v -s + pytest: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.10"] + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + + - name: Test with pytest + run: | + cd Backend && coverage run -m pytest -v -s From 4fc5525502386bbb11dcfa8f3d66e8b9a51697ec Mon Sep 17 00:00:00 2001 From: SiriChandanaGarimella <156231102+SiriChandanaGarimella@users.noreply.github.com> Date: Mon, 22 Apr 2024 14:52:03 -0500 Subject: [PATCH 3/3] Added dependencies in python-app1.yml --- .github/workflows/python-app1.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/python-app1.yml b/.github/workflows/python-app1.yml index 655128f5..5462dbbd 100644 --- a/.github/workflows/python-app1.yml +++ b/.github/workflows/python-app1.yml @@ -20,6 +20,7 @@ jobs: run: | python -m pip install --upgrade pip pip install pytest + pip install pytest coverage if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Test with pytest