correct example version #128
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: Run Maven Tests | |
on: | |
push: | |
branches: | |
- main | |
- release/* | |
- gh-actions-test* | |
pull_request: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
# https://github.com/actions/virtual-environments/issues/709 | |
- name: " Free disk space" | |
run: | | |
sudo rm -rf "/usr/local/share/boost" | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
sudo apt-get clean | |
df -h | |
- name: " Checkout repository" | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: " Set up JDK 17" | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'zulu' | |
cache: maven | |
- name: Cache SonarCloud packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.sonar/cache | |
key: ${{ runner.os }}-sonar | |
restore-keys: ${{ runner.os }}-sonar | |
- name: Cache Maven packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
restore-keys: ${{ runner.os }}-m2 | |
- name: "SonarCloud Scan" | |
env: | |
THRESHR_KEY: ${{ secrets.THRESHR_KEY }} | |
THRESHR_CHANNEL: ${{ secrets.THRESHR_CHANNEL }} | |
TEST_DATASOURCES_DEFAULT_URL: ${{ secrets.TEST_DATASOURCES_DEFAULT_URL }} | |
GITHUB_TOKEN: ${{ secrets.SONAR_GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
run: | | |
mvn -Pcoverage -Dmaven.verify.skip=true test org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=Graqr_Threshr | |
mvn verify -Dmaven.verify.skip=true org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=Graqr_Threshr | |
# on windows, add double quotes like below | |
#.\mvnw -Pcoverage test org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=Graqr_Threshr | |
#.\mvnw verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -D"sonar.projectKey=Graqr_Threshr" |