ci: ajout deploiement automatique #32
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: | |
runs-on: ubuntu-22.04 | |
steps: | |
#checkout your github code using actions/[email protected] | |
- uses: actions/[email protected] | |
#do the same with another action (actions/setup-java@v3) that enable to setup jdk 17 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: "temurin" # See 'Supported distributions' for available options | |
java-version: "21" | |
#finally build your app with the latest command | |
- name: Build and test with Maven | |
working-directory: backend-api | |
run: mvn clean verify | |
- 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 }} |