deps(docker-backend)(deps): bump python from 3.11-slim to 3.13-slim in /src/backend #697
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint | |
on: | |
push: | |
branches: [ main, develop ] | |
pull_request: | |
branches: [ main, develop ] | |
env: | |
NODE_VERSION: '18' | |
PYTHON_VERSION: '3.11' | |
jobs: | |
backend-lint: | |
name: Backend Code Quality | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 # actions/checkout v3 | |
with: | |
fetch-depth: 0 # Required for SonarQube analysis | |
- name: Set up Python ${{ env.PYTHON_VERSION }} | |
uses: actions/setup-python@v4 # actions/setup-python v4 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
cache: 'pip' | |
- name: Set up Node.js ${{ env.NODE_VERSION }} | |
uses: actions/setup-node@v3 # actions/setup-node v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache: 'npm' | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pylint==2.17.0 flake8==6.0.0 mypy==1.3.0 pytest==7.4.0 pytest-cov==4.1.0 | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi | |
- name: Install Node.js dependencies for backend TypeScript | |
run: | | |
if [ -f package.json ]; then npm ci; fi | |
- name: Run ESLint on backend TypeScript | |
run: | | |
if [ -d src ] && [ -f .eslintrc.backend.js ]; then | |
npx eslint --config .eslintrc.backend.js "src/**/*.ts" | |
fi | |
- name: Run Pylint | |
run: | | |
if [ -d src ] && [ -f .pylintrc ]; then | |
pylint --rcfile=.pylintrc --fail-under=9.0 src/ tests/ | |
fi | |
- name: Run Flake8 | |
run: | | |
if [ -d src ] && [ -f .flake8 ]; then | |
flake8 --config=.flake8 src/ tests/ | |
fi | |
- name: Run MyPy | |
run: | | |
if [ -d src ] && [ -f mypy.ini ]; then | |
mypy --config-file=mypy.ini src/ | |
fi | |
- name: Run Python tests with coverage | |
run: | | |
if [ -d tests ]; then | |
pytest --cov=src --cov-report=xml --junitxml=test-results.xml tests/ | |
fi | |
- name: SonarQube Analysis | |
uses: SonarSource/[email protected] # SonarSource/sonarcloud-github-action v1.8 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
with: | |
args: > | |
-Dsonar.projectKey=${{ secrets.SONAR_PROJECT_KEY }} | |
-Dsonar.organization=${{ secrets.SONAR_ORGANIZATION }} | |
-Dsonar.sources=src | |
-Dsonar.tests=tests | |
-Dsonar.python.coverage.reportPaths=coverage.xml | |
-Dsonar.python.xunit.reportPath=test-results.xml | |
-Dsonar.python.pylint.reportPath=pylint-report.txt | |
-Dsonar.qualitygate.wait=true | |
-Dsonar.coverage.exclusions=**/tests/**/* | |
-Dsonar.cpd.exclusions=**/tests/**/* | |
frontend-lint: | |
name: Frontend Code Quality | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 # actions/checkout v3 | |
with: | |
fetch-depth: 0 # Required for SonarQube analysis | |
- name: Set up Node.js ${{ env.NODE_VERSION }} | |
uses: actions/setup-node@v3 # actions/setup-node v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache: 'npm' | |
- name: Install dependencies | |
run: | | |
if [ -d frontend ] && [ -f frontend/package.json ]; then | |
cd frontend | |
npm ci | |
fi | |
- name: Run ESLint | |
run: | | |
if [ -d frontend/src ] && [ -f frontend/.eslintrc.js ]; then | |
cd frontend | |
npx eslint --config .eslintrc.js "src/**/*.{ts,tsx,js,jsx}" | |
fi | |
- name: TypeScript type checking | |
run: | | |
if [ -d frontend/src ] && [ -f frontend/tsconfig.json ]; then | |
cd frontend | |
npx tsc --noEmit | |
fi | |
- name: Verify documentation coverage | |
run: | | |
if [ -d frontend/src/components ] && [ -f frontend/scripts/verify-documentation-coverage.js ]; then | |
cd frontend | |
npx react-docgen-typescript --out documentation.json "src/components/**/*.tsx" | |
node scripts/verify-documentation-coverage.js --min-coverage=100 --public-only | |
fi | |
- name: Run frontend tests with coverage | |
run: | | |
if [ -d frontend ] && [ -f frontend/package.json ]; then | |
cd frontend | |
npm test -- --coverage --ci --reporters=default --reporters=jest-junit | |
fi | |
- name: SonarQube Analysis | |
uses: SonarSource/[email protected] # SonarSource/sonarcloud-github-action v1.8 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
with: | |
args: > | |
-Dsonar.projectKey=${{ secrets.SONAR_PROJECT_KEY }}-frontend | |
-Dsonar.organization=${{ secrets.SONAR_ORGANIZATION }} | |
-Dsonar.sources=frontend/src | |
-Dsonar.tests=frontend/src/__tests__ | |
-Dsonar.javascript.lcov.reportPaths=frontend/coverage/lcov.info | |
-Dsonar.testExecutionReportPaths=frontend/test-report.xml | |
-Dsonar.qualitygate.wait=true | |
-Dsonar.coverage.exclusions=**/__tests__/**,**/node_modules/** | |
-Dsonar.cpd.exclusions=**/__tests__/**,**/node_modules/** |