From 9a777ffc3dc298774d97a5bc83e31229643ef29c Mon Sep 17 00:00:00 2001 From: Amanat Ali Date: Sat, 11 Oct 2025 15:39:54 +0500 Subject: [PATCH 1/6] Create python-app.yml --- .github/workflows/python-app.yml | 43 ++++++++++++++++++++++++++++++++ 1 file changed, 43 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..be1bf2a --- /dev/null +++ b/.github/workflows/python-app.yml @@ -0,0 +1,43 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: Python application + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.13 + uses: actions/setup-python@v3 + with: + python-version: "3.13" + - 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: Run Playwright tests + uses: microsoft/playwright-github-action@v1.5.7 + - name: Test with pytest + run: | + pytest + From c8dbbb8b7fa9f8bed668e379b50d00e0e4280caa Mon Sep 17 00:00:00 2001 From: Amanat Ali Date: Sat, 11 Oct 2025 15:48:17 +0500 Subject: [PATCH 2/6] Update python-app.yml --- .github/workflows/python-app.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index be1bf2a..fd5441a 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -35,9 +35,9 @@ 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: Run Playwright tests - uses: microsoft/playwright-github-action@v1.5.7 - - name: Test with pytest + - name: install Playwright browser + run: playwright install chromium + - name: Test with pytest && playweight run: | pytest From 9e79a0778cdb2955132337a4b77cbd5ec4115ea9 Mon Sep 17 00:00:00 2001 From: Amanat Ali Date: Sat, 11 Oct 2025 15:54:42 +0500 Subject: [PATCH 3/6] Update python-app.yml --- .github/workflows/python-app.yml | 64 ++++++++++++++++++-------------- 1 file changed, 36 insertions(+), 28 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index fd5441a..d6f826f 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -1,7 +1,4 @@ -# This workflow will install Python dependencies, run tests and lint with a single version of Python -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python - -name: Python application +name: Python Tests on: push: @@ -14,30 +11,41 @@ permissions: jobs: build: - runs-on: ubuntu-latest + env: + ADMIN_USERNAME: ${{ secrets.ADMIN_USERNAME }} + ADMIN_PASSWORD: ${{ secrets.ADMIN_PASSWORD }} + SUPABASE_URL: ${{ secrets.SUPABASE_URL }} + SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.SUPABASE_SERVICE_ROLE_KEY }} + # optional fallbacks + SUPABASE_ANON_KEY: ${{ secrets.SUPABASE_ANON_KEY }} + SUPERBASE_S3_BUCKET_NAME: ${{ secrets.SUPABASE_ANON_KEY }} + steps: - - uses: actions/checkout@v4 - - name: Set up Python 3.13 - uses: actions/setup-python@v3 - with: - python-version: "3.13" - - 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: install Playwright browser - run: playwright install chromium - - name: Test with pytest && playweight - run: | - pytest - + - uses: actions/checkout@v4 + + - name: Set up Python 3.13 + uses: actions/setup-python@v5 + with: + python-version: "3.13" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest playwright + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + + - name: Install Playwright browsers + run: | + playwright install --with-deps chromium + + - name: Lint with flake8 + run: | + # Stop build if there are syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # Exit-zero treats all errors as warnings (so build continues) + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + + - name: Run pytest + run: pytest -v --maxfail=3 --disable-warnings From bc2dad446b5e3faef5d9c3a4576dfe1a6555787b Mon Sep 17 00:00:00 2001 From: Amanat Ali Date: Sat, 11 Oct 2025 16:12:44 +0500 Subject: [PATCH 4/6] Update python-app.yml --- .github/workflows/python-app.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index d6f826f..334536a 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -46,6 +46,7 @@ jobs: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # Exit-zero treats all errors as warnings (so build continues) flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - + - name: Run flask app + run: python app.py - name: Run pytest run: pytest -v --maxfail=3 --disable-warnings From ca4739b5561ac63693962f45dfdc2e7c79eba37d Mon Sep 17 00:00:00 2001 From: Amanat Ali Date: Sat, 11 Oct 2025 17:37:07 +0500 Subject: [PATCH 5/6] Update python-app.yml --- .github/workflows/python-app.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 334536a..d38b6db 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -8,7 +8,6 @@ on: permissions: contents: read - jobs: build: runs-on: ubuntu-latest @@ -17,10 +16,9 @@ jobs: ADMIN_USERNAME: ${{ secrets.ADMIN_USERNAME }} ADMIN_PASSWORD: ${{ secrets.ADMIN_PASSWORD }} SUPABASE_URL: ${{ secrets.SUPABASE_URL }} - SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.SUPABASE_SERVICE_ROLE_KEY }} - # optional fallbacks - SUPABASE_ANON_KEY: ${{ secrets.SUPABASE_ANON_KEY }} - SUPERBASE_S3_BUCKET_NAME: ${{ secrets.SUPABASE_ANON_KEY }} + SUPERBASE_SERVICE_ROLE_KEY: ${{ secrets.SUPERBASE_SERVICE_ROLE_KEY }} + SUPABASE_ANON_KEY: ${{ secrets.SUPERBASE_ANON_KEY }} + SUPERBASE_S3_BUCKET_NAME: ${{ secrets.SUPERBASE_S3_BUCKET_NAME }} steps: - uses: actions/checkout@v4 From d625e7728967a2f99f646349911cb6757b56c852 Mon Sep 17 00:00:00 2001 From: Amanat Ali Date: Sat, 11 Oct 2025 17:42:34 +0500 Subject: [PATCH 6/6] Update python-app.yml --- .github/workflows/python-app.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index d38b6db..a9b023d 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -44,7 +44,5 @@ jobs: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # Exit-zero treats all errors as warnings (so build continues) flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Run flask app - run: python app.py - name: Run pytest run: pytest -v --maxfail=3 --disable-warnings