ci: changement clé ssh #49
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: Tests | |
on: | |
push: | |
pull_request: | |
jobs: | |
test-backend: | |
# We request an environment based on ubuntu 22.04, but this setting also supports | |
# taking in docker images. | |
runs-on: ubuntu-22.04 | |
steps: | |
# We get our repository code via this action | |
- uses: actions/[email protected] | |
# We use the setup java action to get a temurin JDK 21 to test our backend code | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: "temurin" | |
java-version: "21" | |
# We finally launch our maven clean (to ensure we clean our environment to reduce noise) | |
# And we use the verify command to test our app | |
- name: Build and test with Maven | |
working-directory: backend-api | |
run: mvn clean verify | |
# Once everything is setup, we simply send our code to sonar using | |
# The built-in sonarqube sonarqube plugin of maven. We pass our project key, org, | |
# and token (in a secret), through. | |
- name: Send to sonarcloud for static analysis | |
working-directory: backend-api | |
run: mvn -B verify sonar:sonar -Dsonar.projectKey=${{ vars.SONAR_PROJECT_KEY }} -Dsonar.organization=${{ vars.SONAR_ORGANIZATION }} -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_TOKEN }} |