The standalone sonar-scanner CLI has Java discovery issues in the build container. Switch to the Maven sonar plugin (same approach as cameleer3 agent repo), which uses Maven's own JDK. This also removes the sonar-scanner download/install step entirely. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
72 lines
2.3 KiB
YAML
72 lines
2.3 KiB
YAML
name: SonarQube
|
|
|
|
on:
|
|
schedule:
|
|
- cron: '0 2 * * *'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
sonarqube:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: gitea.siegeln.net/cameleer/cameleer-build:1
|
|
credentials:
|
|
username: cameleer
|
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Configure Gitea Maven Registry
|
|
run: |
|
|
mkdir -p ~/.m2
|
|
cat > ~/.m2/settings.xml << 'SETTINGS'
|
|
<settings>
|
|
<servers>
|
|
<server>
|
|
<id>gitea</id>
|
|
<username>cameleer</username>
|
|
<password>${env.REGISTRY_TOKEN}</password>
|
|
</server>
|
|
</servers>
|
|
</settings>
|
|
SETTINGS
|
|
env:
|
|
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
|
|
|
- name: Cache Maven dependencies
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/.m2/repository
|
|
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
|
restore-keys: ${{ runner.os }}-maven-
|
|
|
|
- name: Build and Test Java
|
|
run: mvn clean verify -DskipITs -U --batch-mode
|
|
|
|
- name: Install UI dependencies
|
|
working-directory: ui
|
|
run: |
|
|
echo '//gitea.siegeln.net/api/packages/cameleer/npm/:_authToken=${REGISTRY_TOKEN}' >> .npmrc
|
|
npm ci
|
|
env:
|
|
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
|
|
|
- name: Lint UI
|
|
working-directory: ui
|
|
run: npm run lint -- --format json --output-file eslint-report.json || true
|
|
|
|
- name: SonarQube Analysis
|
|
run: |
|
|
mvn sonar:sonar --batch-mode \
|
|
-Dsonar.host.url=${{ secrets.SONAR_HOST_URL }} \
|
|
-Dsonar.token=${{ secrets.SONAR_TOKEN }} \
|
|
-Dsonar.projectKey=cameleer3-server \
|
|
-Dsonar.projectName="Cameleer3 Server" \
|
|
-Dsonar.sources=cameleer3-server-core/src/main/java,cameleer3-server-app/src/main/java,ui/src \
|
|
-Dsonar.tests=cameleer3-server-core/src/test/java,cameleer3-server-app/src/test/java \
|
|
-Dsonar.typescript.eslint.reportPaths=ui/eslint-report.json \
|
|
-Dsonar.eslint.reportPaths=ui/eslint-report.json \
|
|
-Dsonar.exclusions="ui/node_modules/**,ui/dist/**,**/target/**"
|