Merge pull request #15 from FabricCompatibilityLayers/feature/sonar-j… #114
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: Build and Publish | |
on: [push, pull_request, workflow_dispatch] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Validate Gradle Wrapper | |
uses: gradle/wrapper-validation-action@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: temurin | |
- name: Build | |
run: ./gradlew build -x test | |
- name: Test | |
run: ./gradlew test check | |
- name: Sonar | |
run: ./gradlew jacocoTestCoverageVerification jacocoTestReport sonar | |
env: | |
SONAR_URL: ${{ secrets.SONAR_URL }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
- if: github.repository == 'FabricCompatibilityLayers/Mod-Remapping-API' && github.ref_type == 'tag' | |
name: Publish | |
run: ./gradlew build modrinth | |
env: | |
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} | |
- name: Store reports if any | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: reports | |
path: | | |
**/build/reports/ | |
**/build/test-results/ |