From 0dc3ad5797f124682050e5fb4c0147a1377da8d3 Mon Sep 17 00:00:00 2001 From: Muhammad Hunain <141824020+M-Hunain5037@users.noreply.github.com> Date: Fri, 7 Jun 2024 20:00:12 +0500 Subject: [PATCH 01/10] Create main.yml --- .github/workflows/main.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..1169102 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,35 @@ +name: Python Assg + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.9", "3.10"] + + steps: + - uses: actions/checkout@v4 + - 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 + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Lint with flake8 + run: | + pip install flake8 + 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 unittest + run: | + python -m unittest test_main.py From 75d6a9091332c62ed45ee5e64f080ad642b364ee Mon Sep 17 00:00:00 2001 From: Muhammad Hunain <141824020+M-Hunain5037@users.noreply.github.com> Date: Fri, 7 Jun 2024 20:03:41 +0500 Subject: [PATCH 02/10] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1169102..e15927d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,7 +24,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + if (Test-Path requirements.txt) { pip install -r requirements.txt } - name: Lint with flake8 run: | pip install flake8 From b4554c561861b1cbf54b8175efe88a06546f9b2d Mon Sep 17 00:00:00 2001 From: Muhammad Hunain <141824020+M-Hunain5037@users.noreply.github.com> Date: Fri, 7 Jun 2024 20:10:28 +0500 Subject: [PATCH 03/10] Update main.yml --- .github/workflows/main.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e15927d..2d99feb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,11 +25,6 @@ jobs: run: | python -m pip install --upgrade pip if (Test-Path requirements.txt) { pip install -r requirements.txt } - - name: Lint with flake8 - run: | - pip install flake8 - 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 unittest run: | python -m unittest test_main.py From 6cb56b879286b6cd2b0bf48b18134713762978d0 Mon Sep 17 00:00:00 2001 From: Muhammad Hunain <141824020+M-Hunain5037@users.noreply.github.com> Date: Fri, 7 Jun 2024 20:14:42 +0500 Subject: [PATCH 04/10] Update main.yml --- .github/workflows/main.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2d99feb..1c009cf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,6 +25,16 @@ jobs: run: | python -m pip install --upgrade pip if (Test-Path requirements.txt) { pip install -r requirements.txt } + - name: Lint with flake8 + run: | + pip install flake8 + 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 unittest run: | python -m unittest test_main.py + - name: SonarQube Scan + uses: sonarsource/sonarqube-scan-action@master + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} From ecd1b8d4705cdf52c2beffc88c99d8cb3dab9457 Mon Sep 17 00:00:00 2001 From: Muhammad Hunain <141824020+M-Hunain5037@users.noreply.github.com> Date: Fri, 7 Jun 2024 20:18:11 +0500 Subject: [PATCH 05/10] Update main.yml --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1c009cf..b43ca36 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,7 +9,7 @@ on: jobs: build: - runs-on: windows-latest + runs-on: ubuntu-latest strategy: fail-fast: false matrix: @@ -24,7 +24,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - if (Test-Path requirements.txt) { pip install -r requirements.txt } + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Lint with flake8 run: | pip install flake8 From 1ca8dc45b95ecd834cff5e43ebd546fa45e2b42a Mon Sep 17 00:00:00 2001 From: Muhammad Hunain <141824020+M-Hunain5037@users.noreply.github.com> Date: Fri, 7 Jun 2024 20:38:56 +0500 Subject: [PATCH 06/10] Update main.yml --- .github/workflows/main.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b43ca36..b4aa8db 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,3 +1,4 @@ + name: Python Assg on: @@ -9,7 +10,7 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: windows-latest strategy: fail-fast: false matrix: @@ -24,7 +25,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + if (Test-Path requirements.txt) { pip install -r requirements.txt } - name: Lint with flake8 run: | pip install flake8 From ae22bf25e5b2822327a098bec60e25721cd9dc60 Mon Sep 17 00:00:00 2001 From: Muhammad Hunain <141824020+M-Hunain5037@users.noreply.github.com> Date: Fri, 7 Jun 2024 20:39:25 +0500 Subject: [PATCH 07/10] Update main.yml --- .github/workflows/main.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b4aa8db..2d99feb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,3 @@ - name: Python Assg on: @@ -26,16 +25,6 @@ jobs: run: | python -m pip install --upgrade pip if (Test-Path requirements.txt) { pip install -r requirements.txt } - - name: Lint with flake8 - run: | - pip install flake8 - 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 unittest run: | python -m unittest test_main.py - - name: SonarQube Scan - uses: sonarsource/sonarqube-scan-action@master - env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} From 1b64a4ddb8054f8aa34980f5d184dc4b32159ee1 Mon Sep 17 00:00:00 2001 From: Muhammad Hunain <141824020+M-Hunain5037@users.noreply.github.com> Date: Fri, 7 Jun 2024 22:17:46 +0500 Subject: [PATCH 08/10] Update main.yml From 926452b12f1c0330375be8170487ba1b9bb20bc2 Mon Sep 17 00:00:00 2001 From: Muhammad Hunain <141824020+M-Hunain5037@users.noreply.github.com> Date: Fri, 7 Jun 2024 22:46:28 +0500 Subject: [PATCH 09/10] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2d99feb..11c63b2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,7 +12,7 @@ jobs: runs-on: windows-latest strategy: fail-fast: false - matrix: + matrix: python-version: ["3.9", "3.10"] steps: From 07328edda96ef784f73f3e1def0664c6a5ce606e Mon Sep 17 00:00:00 2001 From: Muhammad Hunain <141824020+M-Hunain5037@users.noreply.github.com> Date: Fri, 7 Jun 2024 22:47:22 +0500 Subject: [PATCH 10/10] Update main.yml --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 11c63b2..94810f1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,3 +28,4 @@ jobs: - name: Test with unittest run: | python -m unittest test_main.py +