Skip to content

Commit

Permalink
Update backend-ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
pdr21001 authored Apr 25, 2025
1 parent 13e1c4b commit 9b9877a
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions backend/.github/workflows/backend-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ jobs:
runs-on: self-hosted

steps:
- name: Checkout code
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: false # 🚫 Don't check submodules to avoid .gitmodules error

- name: Set up Python
uses: actions/setup-python@v2
Expand All @@ -35,8 +37,10 @@ jobs:
needs: lint

steps:
- name: Checkout code
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: false

- name: Set up Python
uses: actions/setup-python@v2
Expand All @@ -49,14 +53,14 @@ jobs:
source venv/bin/activate
pip install -r backend/requirements.txt
pip install pytest-html
- name: Run pylint on Python code
- name: Run pylint with score check
run: |
source venv/bin/activate
pylint backend/main.py backend/db.py backend/init_db.py --exit-zero | tee pylint.log
SCORE=$(tail -n 2 pylint.log | grep -oP '[0-9]+\.[0-9]+(?=/10)')
echo "Pylint score: $SCORE"
python -c "import sys; sys.exit(0 if float('$SCORE') >= 8.0 else 1)"
source venv/bin/activate
pylint backend/main.py backend/db.py backend/init_db.py --exit-zero | tee pylint.log
SCORE=$(tail -n 2 pylint.log | grep -oP '[0-9]+\.[0-9]+(?=/10)')
echo "Pylint score: $SCORE"
python -c "import sys; sys.exit(0 if float('$SCORE') >= 8.0 else 1)"
- name: Start Flask API server
run: |
Expand Down Expand Up @@ -90,9 +94,12 @@ jobs:
build-frontend:
runs-on: self-hosted
needs: lint

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: false

- name: Set up Node.js
uses: actions/setup-node@v3
Expand All @@ -105,4 +112,4 @@ jobs:

- name: Build frontend app
working-directory: frontend
run: npm run build
run: npm run build

0 comments on commit 9b9877a

Please sign in to comment.