run with test containers #12
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: SonarCloud Scan | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'server/**' | |
workflow_dispatch: # add ability to run workflow. | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
sonarCloudServer: | |
name: sonarCloudServer | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: 'temurin' | |
- name: Cache SonarQube packages | |
uses: actions/cache@v4 | |
with: | |
path: ~/.sonar/cache | |
key: ${{ runner.os }}-sonar | |
restore-keys: ${{ runner.os }}-sonar | |
- name: Cache Gradle packages | |
uses: actions/cache@v4 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | |
restore-keys: ${{ runner.os }}-gradle | |
- name: sonarQube Scan 1 | |
env: | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # analysis token associated to your project | |
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} | |
run: | | |
cd server/ | |
./gradlew build test sonar --info |