👷 ci(build): enhance sonar job in build workflow

- add container support with node:20-alpine for sonar job
- consolidate git and utility installation steps
- include sonarqube-scanner installation for improved analysis
This commit is contained in:
nocci 2026-01-08 15:55:20 +00:00
parent 7df5c2e2fe
commit d1d6ba58b7

View file

@ -30,18 +30,23 @@ jobs:
- name: Run ESLint
run: npm run lint
sonar:
needs: lint
runs-on: self-hosted
steps:
- name: Manual Git Checkout
run: |
apt-get update
apt-get install -y git
git init
git remote add origin ${{ env.REPO_URL }}/${{ github.repository }}.git
git fetch --depth 1 origin ${{ github.ref }}
git checkout FETCH_HEAD
sonar:
needs: lint
runs-on: self-hosted
container:
image: node:20-alpine
steps:
- name: Manual Git Checkout and Prepare
run: |
apk add --no-cache git curl bash
git init
git remote add origin ${{ env.REPO_URL }}/${{ github.repository }}.git
git fetch --depth 1 origin ${{ github.ref }}
git checkout FETCH_HEAD
- name: Install Node.js and Sonar Scanner
run: |
npm install -g sonarqube-scanner
- name: Install Node.js
run: |