chore(deps): update gradle to v9 #1572
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: Build | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| branches: | |
| - master | |
| jobs: | |
| # For maven project | |
| build: | |
| strategy: | |
| max-parallel: 1 | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| java: [21] | |
| runs-on: ${{ matrix.os }} | |
| name: Maven Build with Java ${{ matrix.java }} on ${{ matrix.os }} | |
| steps: | |
| - name: "Checkout" | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Java ${{ matrix.java }} | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: ${{ matrix.java }} | |
| distribution: "temurin" | |
| - name: "Cache Local Maven Repository" | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.m2 | |
| key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: ${{ runner.os }}-m2 | |
| - name: "CheckStyle" | |
| run: mvn -ntp validate --errors | |
| - name: "Compile and Install" | |
| run: mvn -ntp clean install -DskipTests --errors | |
| - name: "Unit Tests" | |
| run: mvn -ntp test --errors --fail-at-end | |
| - name: "Integration Tests" | |
| run: mvn -ntp failsafe:integration-test --errors --fail-at-end | |
| # The following is only executed on Ubuntu on Java 21 | |
| - name: "JaCoCo Coverage Report" | |
| if: matrix.os == 'ubuntu-latest' && matrix.java == 21 && github.repository == 'castor-software/depclean' | |
| run: mvn -ntp jacoco:report | |
| - name: "Codecov" | |
| if: matrix.os == 'ubuntu-latest' && matrix.java == 21 && github.repository == 'castor-software/depclean' | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ./depclean-maven-plugin/target/site/jacoco/jacoco.xml,./depclean-core/target/site/jacoco/jacoco.xml | |
| flags: unittests | |
| - name: "Cache SonarCloud" | |
| if: matrix.os == 'ubuntu-latest' && matrix.java == 21 && github.repository == 'castor-software/depclean' | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.sonar/cache | |
| key: ${{ runner.os }}-sonar | |
| restore-keys: ${{ runner.os }}-sonar | |
| - name: "SonarCloud" | |
| if: matrix.os == 'ubuntu-latest' && matrix.java == 21 && github.repository == 'castor-software/depclean' | |
| run: mvn -ntp sonar:sonar -Dsonar.projectKey=castor-software_depclean -Dsonar.organization=castor-software -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_TOKEN }} -Dsonar.java.source=21 -Dsonar.java.target=21 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| # -------------------------------------------------------------------------------------------------------------------- | |
| # For Gradle module | |
| gradle: | |
| name: Gradle build with Java 21 on ubuntu-latest | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4.3.0 | |
| - name: Set up Java 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 21 | |
| distribution: "temurin" | |
| - name: Cache Gradle packages | |
| uses: actions/cache@v3.4.3 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| ~/.m2 | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: Build with maven (Building missing/local dependencies) | |
| run: mvn clean install -DskipTests -q | |
| - name: Build with Gradle | |
| working-directory: ./depclean-gradle-plugin | |
| run: | | |
| git update-index --chmod=+x gradlew | |
| ./gradlew clean publishToMavenLocal build |