Nightly #1041
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: 'Nightly' | |
on: | |
schedule: | |
- cron: '1 3 * * *' | |
jobs: | |
nightly_build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 21 | |
- name: Cache dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Build, run all tests and package artifact with Maven | |
run: | | |
PROJECT_VERSION=$(mvn -B org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout) | |
NIGHTLY_VERSION=$(echo $GITHUB_SHA | cut -c1-8) | |
mvn -B versions:set -DnewVersion=$PROJECT_VERSION.$NIGHTLY_VERSION-SNAPSHOT | |
mvn -B clean verify -f pom.xml | |
- name: Save Jacoco Exec | |
uses: actions/upload-artifact@v4 | |
with: | |
name: jacoco_coverage.exec | |
path: target/jacoco.exec | |
- name: Save Jacoco XML Report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: jacoco_coverage_report.xml | |
path: target/site/jacoco/jacoco.xml | |
- name: SonarCloud Scan | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
run: | | |
mvn -B verify sonar:sonar \ | |
-Dsonar.projectKey='marcosDLCS_urjc_mca_ci_delivery' \ | |
-Dsonar.projectName='URJC MCA CI-DELIVERY' \ | |
-Dsonar.host.url=https://sonarcloud.io \ | |
-Dsonar.organization=marcosdlcs \ | |
-Dsonar.login=${{ secrets.SONAR_TOKEN }} \ | |
-Dsonar.java.coveragePlugin=jacoco \ | |
-Dsonar.coverage.jacoco.xmlReportPaths=target/site/jacoco/jacoco.xml | |
- name: OWASP Dependency Check | |
run: mvn -B dependency-check:check -f pom.xml | |
- name: Save Dependency Check Report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dependency_check_report.html | |
path: target/dependency-check-report.html | |
- name: Mutation Testing | |
run: mvn -B org.pitest:pitest-maven:mutationCoverage -f pom.xml | |
- name: Save Mutation Testing Report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: mutation_testing_report.xml | |
path: target/pit-reports/**/mutations.xml |