Mutation tests step #11
This file contains hidden or 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: CI Pipeline | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| build-test: | |
| name: Build & Unit Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v3 | |
| - name: Set Up JDK 17 | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Cache Maven Packages | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.m2 | |
| key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-m2- | |
| - name: Build and run unit tests | |
| run: | | |
| export MAVEN_OPTS="-Djansi.force=true" | |
| mvn -B clean verify -DskipITs=true sonar:sonar \ | |
| -Dsonar.projectKey=code-quality-testing \ | |
| -Dsonar.organization=peterm85 \ | |
| -Dsonar.host.url=https://sonarcloud.io \ | |
| -Dsonar.login=${{ secrets.SONAR_TOKEN }} \ | |
| -Dsonar.sources=src/main \ | |
| -Dsonar.tests=src/test \ | |
| -Dsonar.junit.reportPaths=target/surefire-reports \ | |
| -Dsonar.coverage.jacoco.xmlReportPaths=target/site/jacoco/jacoco.xml \ | |
| -Dsonar.exclusions=**/*Application.java | |
| integration-test: | |
| name: Integration Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v3 | |
| - name: Set Up JDK 17 | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Cache Maven Packages | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.m2 | |
| key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-m2- | |
| - name: Build and run integration tests | |
| run: | | |
| export MAVEN_OPTS="-Djansi.force=true" | |
| mvn -B clean verify -DskipUTs=true | |
| mutation-test: | |
| name: Mutation Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v3 | |
| - name: Set Up JDK 17 | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Cache Maven Packages | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.m2 | |
| key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-m2- | |
| - name: Build and run mutation tests | |
| run: | | |
| export MAVEN_OPTS="-Djansi.force=true" | |
| mvn -B clean test-compile org.pitest:pitest-maven:mutationCoverage -DwithHistory |