Skip to content

Commit

Permalink
Test sonar cloud
Browse files Browse the repository at this point in the history
  • Loading branch information
Pelayori committed Mar 10, 2024
1 parent e349dc9 commit 62f8c06
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/unit-tests-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ on:
jobs:
unit-tests:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:latest
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: test_database
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v1
- name: Set up JDK
Expand All @@ -17,8 +26,9 @@ jobs:
java-version: '17'
- name: Add exec permission to mvnw
run: chmod +x mvnw
- name: Analyze with SonarCloud
run: ./mvnw -B verify sonar:sonar -Dsonar.projectKey=wiq_es04b -Dsonar.organization=Arquisoft -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=$SONAR_TOKEN
- name: Build and test
run: |
./mvnw -B clean verify sonar:sonar -Dsonar.projectKey=wiq_es04b -Dsonar.organization=Arquisoft -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=$SONAR_TOKEN -Dspring.profiles.active=test -Dspring.datasource.url=jdbc:mysql://localhost:3306/test_database -Dspring.datasource.username=root -Dspring.datasource.password=root
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

0 comments on commit 62f8c06

Please sign in to comment.