Update junit-framework monorepo #1332
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: Java CI | |
| on: | |
| pull_request: | |
| merge_group: | |
| push: | |
| branches: | |
| - 'main' | |
| tags: | |
| - '[0-9]+.[0-9]+.[0-9]+*' | |
| release: | |
| types: | |
| - created | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| java: [17] | |
| name: Java ${{ matrix.java }} Run | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up JDK ${{ matrix.java }} | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'zulu' | |
| java-version: ${{ matrix.java }} | |
| - name: Cache Maven Dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ares-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ares-maven- | |
| - name: Test with Maven and JDK ${{ matrix.java }} | |
| run: mvn -B clean test | |
| test-gradle: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| java: [17] | |
| name: Java ${{ matrix.java }} Gradle Run | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up JDK ${{ matrix.java }} | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'temurin' | |
| java-version: ${{ matrix.java }} | |
| - name: Cache Maven Dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ares-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ares-maven- | |
| - name: Move Gradle build file | |
| run: mv ./src/test/resources/build.gradle ./build.gradle | |
| - name: Build and Install with Maven and JDK ${{ matrix.java }} | |
| run: mvn -B clean install -Dmaven.test.skip=true -Dmaven.javadoc.skip=true -Dmaven.source.skip=true | |
| - name: Set up Gradle with JDK ${{ matrix.java }} | |
| uses: gradle/actions/setup-gradle@v4 | |
| with: | |
| gradle-version: 8.14.3 | |
| - name: Run Gradle tests | |
| run: gradle test | |
| code-style: | |
| runs-on: ubuntu-latest | |
| name: Check Code Style | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'temurin' | |
| java-version: 17 | |
| - name: Cache Maven Dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ares-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ares-maven- | |
| - name: Check code style with Maven | |
| run: mvn -B spotless:check | |
| sonar-scanner: | |
| needs: test | |
| runs-on: ubuntu-latest | |
| name: SonarCloud Java 17 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'temurin' | |
| java-version: 17 | |
| - name: Cache SonarQube packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.sonar/cache | |
| key: ${{ runner.os }}-sonar | |
| restore-keys: ${{ runner.os }}-sonar | |
| - name: Cache Maven Dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2 | |
| key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ares-maven- | |
| - name: Build and analyze for SonarCloud | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=ls1intum_Ares | |
| deploy: | |
| if: startsWith(github.event.ref, 'refs/tags/') | |
| needs: [code-style, test, test-gradle] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'temurin' | |
| java-version: 17 | |
| - name: Cache Maven Dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ares-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ares-maven- | |
| - name: Build and Deploy with Maven | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| mkdir -p ~/.m2 | |
| echo "<settings><servers><server><id>github</id><username>MaisiKoleni</username><password>${GITHUB_TOKEN}</password></server></servers></settings>" > ~/.m2/settings.xml | |
| mvn -B -Dmaven.wagon.http.pool=false clean deploy -P github |