Skip to content

Commit 984d5a0

Browse files
committed
Use only one Ubuntu run as Java is externally installed
1 parent bfed048 commit 984d5a0

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

.github/workflows/build.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,11 @@ jobs:
1717
strategy:
1818
fail-fast: false
1919
matrix:
20-
os: [ ubuntu-18.04, ubuntu-20.04, windows-latest ]
20+
os: [ ubuntu-latest, windows-latest ]
2121
java: [ '8', '11', '17' ]
2222
arch: [ 'x86', 'x64' ]
2323
exclude:
24-
- os: ubuntu-18.04
25-
arch: x86
26-
- os: ubuntu-20.04
24+
- os: ubuntu-latest
2725
arch: x86
2826

2927
name: Java ${{ matrix.java }}/${{ matrix.arch }}/${{ matrix.os }}
@@ -44,12 +42,14 @@ jobs:
4442
cache: maven
4543

4644
- name: Build with Maven
47-
if: "${{ !(matrix.arch == 'x64' && matrix.os == 'ubuntu-20.04' && matrix.java == '11') || github.event.pull_request.head.repo.full_name != 'dnsjava/dnsjava' }}"
45+
if: "${{ !(matrix.arch == 'x64' && matrix.os == 'ubuntu-latest' && matrix.java == '11') || github.event.pull_request.head.repo.full_name != 'dnsjava/dnsjava' }}"
4846
run: mvn verify -B -"Dgpg.skip"
4947

50-
# doesn't work with PRs from forks, see https://jira.sonarsource.com/browse/MMF-1371
48+
# doesn't work with PRs from forks, see
49+
# https://portal.productboard.com/sonarsource/1-sonarcloud/c/50-sonarcloud-analyzes-external-pull-request
50+
# or https://jira.sonarsource.com/browse/MMF-1371 (not public anymore)
5151
- name: Cache Sonar plugins
52-
if: "${{ (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/') || github.event.pull_request.head.repo.full_name == 'dnsjava/dnsjava') && matrix.arch == 'x64' && matrix.os == 'ubuntu-20.04' && matrix.java == '11' }}"
52+
if: "${{ (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/') || github.event.pull_request.head.repo.full_name == 'dnsjava/dnsjava') && matrix.arch == 'x64' && matrix.os == 'ubuntu-latest' && matrix.java == '11' }}"
5353
uses: actions/cache@v3
5454
with:
5555
path: ~/.sonar/cache
@@ -58,20 +58,20 @@ jobs:
5858
${{ runner.os }}-sonar
5959
6060
- name: Build with Maven and run Sonar
61-
if: "${{ (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/') || github.event.pull_request.head.repo.full_name == 'dnsjava/dnsjava') && matrix.arch == 'x64' && matrix.os == 'ubuntu-20.04' && matrix.java == '11' }}"
61+
if: "${{ (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/') || github.event.pull_request.head.repo.full_name == 'dnsjava/dnsjava') && matrix.arch == 'x64' && matrix.os == 'ubuntu-latest' && matrix.java == '11' }}"
6262
env:
6363
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6464
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
6565
run: mvn -B -"Dgpg.skip" verify jacoco:report org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
6666

6767
- name: Run codecovc
68-
if: "${{ matrix.arch == 'x64' && matrix.os == 'ubuntu-20.04' && matrix.java == '11' }}"
68+
if: "${{ matrix.arch == 'x64' && matrix.os == 'ubuntu-latest' && matrix.java == '11' }}"
6969
uses: codecov/codecov-action@v3
7070

7171
release:
7272
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')
7373
needs: test
74-
runs-on: ubuntu-20.04
74+
runs-on: ubuntu-latest
7575
steps:
7676
- uses: actions/checkout@v3
7777

0 commit comments

Comments
 (0)