From 9b9877ac21456226aa1b10a1a2ba2d9b35cb0ddf Mon Sep 17 00:00:00 2001 From: Prince D Rusweka Rwabongoya Date: Fri, 25 Apr 2025 06:14:00 -0400 Subject: [PATCH] Update backend-ci.yml --- backend/.github/workflows/backend-ci.yml | 27 +++++++++++++++--------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/backend/.github/workflows/backend-ci.yml b/backend/.github/workflows/backend-ci.yml index b79d630..1d9b44e 100644 --- a/backend/.github/workflows/backend-ci.yml +++ b/backend/.github/workflows/backend-ci.yml @@ -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 @@ -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 @@ -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: | @@ -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 @@ -105,4 +112,4 @@ jobs: - name: Build frontend app working-directory: frontend - run: npm run build \ No newline at end of file + run: npm run build