diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 4defc44..727c571 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -278,18 +278,32 @@ jobs: sonar-analysis: runs-on: ubuntu-latest container: - image: sonarsource/sonar-scanner-cli:latest + image: ubuntu:22.04 env: SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} steps: - name: Install Node.js for checkout action run: | - apk add --no-cache nodejs npm curl + apt-get update && apt-get install -y curl + curl -fsSL https://deb.nodesource.com/setup_20.x | bash - + apt-get install -y nodejs - name: Check out code uses: actions/checkout@v4 + - name: Install Java and SonarScanner + run: | + apt-get update && apt-get install -y wget curl unzip openjdk-17-jre + # Download and install SonarScanner + SONAR_SCANNER_VERSION=$(curl -s https://api.github.com/repos/SonarSource/sonar-scanner-cli/releases/latest | grep tag_name | cut -d '"' -f 4 | sed 's/v//') + wget -q "https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_VERSION}-linux.zip" -O /tmp/sonar-scanner.zip + unzip -q /tmp/sonar-scanner.zip -d /opt + mv /opt/sonar-scanner-${SONAR_SCANNER_VERSION}-linux /opt/sonar-scanner + ln -s /opt/sonar-scanner/bin/sonar-scanner /usr/local/bin/sonar-scanner + chmod +x /usr/local/bin/sonar-scanner + sonar-scanner --version + - name: Verify SonarQube connection run: | echo "Checking SonarQube connectivity..."