Test unit tests #29
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: Application tests | |
on: | |
push: | |
branches: | |
- master | |
- unit-tests | |
- develop | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
app-tests-analyze: | |
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@v2 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: '17' | |
- name: Install Firefox | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y firefox | |
- name: Add exec permission to mvnw | |
run: chmod +x mvnw | |
- name: Run all tests with sonar analysis | |
run: | | |
./mvnw -B clean verify sonar:sonar -Dsonar.projectKey=Arquisoft_wiq_es04b -Dsonar.organization=arquisoft -Dsonar.branch.name=${{ github.ref }} -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_TOKEN }} -Dspring.profiles.active=test -Dspring.datasource.url=jdbc:mysql://localhost:3306/test_database -Dspring.datasource.username=root -Dspring.datasource.password=root -Dspring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver |