diff --git a/.github/workflows/maven-ci.yml b/.github/workflows/maven-ci.yml index 9281c0f3d..19291fa41 100644 --- a/.github/workflows/maven-ci.yml +++ b/.github/workflows/maven-ci.yml @@ -33,7 +33,7 @@ on: jobs: build: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 @@ -49,14 +49,11 @@ jobs: ${{ runner.os }}-maven- # Some tests need screen access - name: Install xvfb - run: sudo apt-get install xvfb - # SonarQube scan does not work for forked repositories + run: sudo apt-get install -y xvfb + # The SonarQube analysis is only for the master branch of the main repository. + # SonarQube scan does not work for forked repositories try changing it to xvfb-run mvn clean verify # See https://jira.sonarsource.com/browse/MMF-1371 - - name: Build with Maven - if: github.ref != 'refs/heads/master' - run: xvfb-run mvn clean verify - name: Build with Maven and run SonarQube analysis - if: github.ref == 'refs/heads/master' run: xvfb-run mvn clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar env: # These two env variables are needed for sonar analysis diff --git a/.github/workflows/maven-pr-builder.yml b/.github/workflows/maven-pr-builder.yml index 7e4f3670f..f970c0ee5 100644 --- a/.github/workflows/maven-pr-builder.yml +++ b/.github/workflows/maven-pr-builder.yml @@ -33,7 +33,7 @@ on: jobs: build: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 @@ -49,9 +49,9 @@ jobs: ${{ runner.os }}-maven- # Some tests need screen access - name: Install xvfb - run: sudo apt-get install xvfb - # SonarQube scan does not work for forked repositories + run: sudo apt-get install -y xvfb + # This worflow is only for building Pull Requests, the master branch runs Sonar analysis on the main repository. + # SonarQube scan does not work for forked repositories. # See https://jira.sonarsource.com/browse/MMF-1371 - name: Build with Maven - if: github.ref != 'refs/heads/master' run: xvfb-run mvn clean verify