Skip to content

fixed the badges of README to point to the main branch #218

fixed the badges of README to point to the main branch

fixed the badges of README to point to the main branch #218

Workflow file for this run

#https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
#https://hyp0th3rmi4.medium.com/configuring-coveralls-io-reports-for-maven-builds-with-github-actions-393b11fa3402
name: GitHub CI
on: [push]
jobs:
spot-bugs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- name: 🐛 Analyze with SpotBugs
run: mvn -B spotbugs:check
build:
needs: spot-bugs
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
java: [11, 17]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java }}
distribution: adopt
cache: maven
- name: Cache Maven packages
uses: actions/cache@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Set up Cache SonarCloud packages
uses: actions/cache@v1
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: 📦 Build with Maven
run: mvn -B jacoco:prepare-agent verify jacoco:report
- name: 🚀 Coveralls Coverage Report Submission
if: ${{ matrix.os == 'ubuntu-latest' && matrix.java =='11'}}
run: mvn coveralls:report --define repoToken=${{ secrets.COVERALLS_REPO_TOKEN }}
- name: 🔎 SonarCloud Scan
if: ${{ matrix.os == 'ubuntu-latest' && matrix.java =='17'}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=ContractAutomataProject_ContractAutomataLib -Dsonar.c.file.suffixes=- -Dsonar.cpp.file.suffixes=- -Dsonar.objc.file.suffixes=-
analyze:
needs: build
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- uses: actions/checkout@v3
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- name: Cache Maven packages
uses: actions/cache@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Set up JDK11
uses: actions/setup-java@v2
with:
java-version: 11
distribution: 'adopt'
cache: maven
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
- name: Autobuild
uses: github/codeql-action/autobuild@v2
- name: 🔎 Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
mutationtesting:
needs: spot-bugs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- name: Set up Cache Maven packages
uses: actions/cache@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Set up JDK11
uses: actions/setup-java@v2
with:
java-version: 11
distribution: 'adopt'
cache: maven
- name: 👽 Mutation Testing with Pitest
run: mvn -DwithHistory test-compile org.pitest:pitest-maven:mutationCoverage
- name: 🚀 Upload Mutation Test Report to Stryker Dashboard
run: ./.github/scripts/upload-mutation-report.sh
env:
API_KEY: ${{ secrets.STRYKER_DASHBOARD_TOKEN }}