|
| 1 | +name: Build PR |
| 2 | +on: [pull_request] |
| 3 | +jobs: |
| 4 | + build_pr: |
| 5 | + if: github.repository_owner == 'OneLiteFeatherNET' |
| 6 | + name: Build Pull Request Branch |
| 7 | + runs-on: ${{ matrix.os }} |
| 8 | + env: |
| 9 | + ONELITEFEATHER_MAVEN_USERNAME: ${{ secrets.ONELITEFEATHER_MAVEN_USERNAME }} |
| 10 | + ONELITEFEATHER_MAVEN_PASSWORD: ${{ secrets.ONELITEFEATHER_MAVEN_PASSWORD }} |
| 11 | + strategy: |
| 12 | + matrix: |
| 13 | + os: [ubuntu-latest, windows-latest, macos-latest] |
| 14 | + steps: |
| 15 | + - name: Checkout Repository |
| 16 | + uses: actions/checkout@v4 |
| 17 | + - name: Setup Java |
| 18 | + uses: actions/setup-java@v4 |
| 19 | + with: |
| 20 | + distribution: temurin |
| 21 | + java-version: 24 |
| 22 | + - name: Setup Gradle |
| 23 | + uses: gradle/actions/setup-gradle@v4 |
| 24 | + - name: Build on ${{ matrix.os }} |
| 25 | + run: ./gradlew clean build test |
| 26 | + - name: Generate JaCoCo Coverage Report |
| 27 | + if: matrix.os == 'ubuntu-latest' |
| 28 | + run: ./gradlew jacocoRootReport |
| 29 | + - name: Upload Coverage Report |
| 30 | + if: matrix.os == 'ubuntu-latest' |
| 31 | + uses: actions/upload-artifact@v4 |
| 32 | + with: |
| 33 | + name: jacoco-report |
| 34 | + path: | |
| 35 | + build/reports/jacoco/jacocoRootReport/html/ |
| 36 | + build/reports/jacoco/jacocoRootReport/jacocoRootReport.xml |
| 37 | + - name: Upload Coverage to Codecov |
| 38 | + if: matrix.os == 'ubuntu-latest' |
| 39 | + uses: codecov/codecov-action@v5 |
| 40 | + with: |
| 41 | + file: build/reports/jacoco/jacocoRootReport/jacocoRootReport.xml |
| 42 | + fail_ci_if_error: false |
| 43 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 44 | + comment: true |
0 commit comments