Skip to content

Commit ada443b

Browse files
committed
Run only on master and PRs, and Sonar only on Ubuntu/x64/Java11
1 parent 4e2d8a0 commit ada443b

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

.github/workflows/build.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
name: dnsjava CI
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
410

511
jobs:
612
test:
@@ -35,16 +41,15 @@ jobs:
3541
architecture: ${{ matrix.arch }}
3642

3743
- name: Build with Maven
44+
if: "${{ !(matrix.arch == 'x64' && matrix.os == 'ubuntu-latest' && matrix.java == '11') }}"
45+
run: mvn verify -B -"Dgpg.skip"
46+
47+
- name: Build with Maven and run Sonar
48+
if: "${{ matrix.arch == 'x64' && matrix.os == 'ubuntu-latest' && matrix.java == '11' }}"
3849
env:
3950
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4051
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
41-
shell: bash
42-
run: |
43-
if [[ "{{ matrix.arch }}" == "x64" && "{{ matrix.os }}" == "ubuntu-latest" && "{{ matrix.java }}" == "11" ]]; then
44-
mvn verify -B -"Dgpg.skip" org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
45-
else
46-
mvn verify -B -"Dgpg.skip"
47-
fi;
52+
run: mvn verify -B -"Dgpg.skip" org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
4853

4954
release:
5055
if: github.ref == 'refs/heads/master'

0 commit comments

Comments
 (0)