From 30530fa509e83153c8dad22b055985042c44027c Mon Sep 17 00:00:00 2001 From: Philipp Dallig Date: Tue, 6 Apr 2021 10:25:23 +0200 Subject: [PATCH] Workflow rewrite --- .github/workflows/testing.yml | 41 +++++++++++++++-------------------- 1 file changed, 17 insertions(+), 24 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 5b66a7b9..21fc4c2c 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -1,41 +1,34 @@ -name: build -on: +name: Testing +on: push: branches: [master] pull_request: branches: [master] - types: [opened, synchronize] + types: [opened, synchronize, reopened] jobs: - OpenJDK-11-with-SonarQube: + MavenTests: runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8', '11' ] + name: Java ${{ matrix.Java }} testing steps: - name: Checkout uses: actions/checkout@v2 with: # Disabling shallow clone is recommended for improving relevancy of reporting fetch-depth: 0 - - name: Set up JDK 11 - uses: actions/setup-java@v1 + - name: Setup java + uses: actions/setup-java@v2 with: - java-version: 11 - - name: Build with Maven - run: mvn -B clean verify sonar:sonar + java-version: ${{ matrix.java }} + distribution: 'adopt' + - name: Testing with Maven + run: mvn -B clean verify + - name: SonarCloud + run: mvn -B sonar:sonar + if: ${{ matrix.java == '11' && env.SONAR_TOKEN != null}} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - OpenJDK8: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - # Disabling shallow clone is recommended for improving relevancy of reporting - fetch-depth: 0 - - name: Set up JDK 8 - uses: actions/setup-java@v1 - with: - java-version: 8 - - name: Build with Maven - run: mvn -B clean verify -