Skip to content

remove useless files #13

remove useless files

remove useless files #13

Workflow file for this run

name: Java CI with Maven
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: maven
- name: Set up MySQL
run: |
sudo apt-get update
sudo apt-get install -y mysql-server
sudo service mysql start
- name: Create MySQL database
run: |
sudo apt-get install mysql-client
mysql -u root -proot -e "CREATE DATABASE IF NOT EXISTS autocrud;"
# Run tests and generate Jacoco coverage report
- name: Run tests with Maven and generate coverage report
run: mvn test jacoco:report
# Upload coverage report as an artifact
- name: Upload coverage report
uses: actions/upload-artifact@v3
with:
name: coverage-report
path: target/site/jacoco/index.html
build:
runs-on: ubuntu-latest
needs: test # This ensures the build job only runs if tests pass
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: maven
# Build the project
- name: Build with Maven
run: mvn -B package -DskipTests=true --file pom.xml
# Save build artifacts
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: build-artifacts
path: target/*.jar
# SonarCloud Analysis
- name: SonarCloud Scan
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
mvn sonar:sonar -Dsonar.projectKey=geo-tp_AutoCrud \
-Dsonar.organization=geo-tp \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.login=${{ secrets.SONAR_TOKEN }}