forked from dnsjava/dnsjava
-
Notifications
You must be signed in to change notification settings - Fork 1
71 lines (60 loc) · 2.15 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: dnsjava CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-20.04, windows-2019 ]
java: [ '8', '11' ]
arch: [ 'x86', 'x64' ]
exclude:
- os: ubuntu-18.04
arch: x86
- os: ubuntu-20.04
arch: x86
name: Java ${{ matrix.java }}/${{ matrix.arch }}/${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
# for Sonar
fetch-depth: 0
- name: Cache Maven dependencies
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: m2-cache-${{ matrix.java }}-${{ matrix.arch }}-${{ matrix.os }}
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java }}
architecture: ${{ matrix.arch }}
distribution: zulu
check-latest: true
- name: Build with Maven
if: "${{ !(matrix.arch == 'x64' && matrix.os == 'ubuntu-20.04' && matrix.java == '11') || github.event.pull_request.head.repo.full_name != 'dnsjava/dnsjava' }}"
run: mvn verify -B -"Dgpg.skip"
# doesn't work with PRs from forks, see https://jira.sonarsource.com/browse/MMF-1371
- name: Build with Maven and run Sonar
if: "${{ (github.ref == 'refs/heads/master' || github.event.pull_request.head.repo.full_name == 'dnsjava/dnsjava') && matrix.arch == 'x64' && matrix.os == 'ubuntu-20.04' && matrix.java == '11' }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B -"Dgpg.skip" verify jacoco:report
- name: Run codecovc
if: "${{ matrix.arch == 'x64' && matrix.os == 'ubuntu-20.04' && matrix.java == '11' }}"
uses: codecov/codecov-action@v1
# Upload jar only on ubuuntu java 11
- name: "Upload jars"
if: ${{ matrix.os == 'ubuntu-20.04' && matrix.java == 11 }}
uses: actions/upload-artifact@v4
with:
name: "jars"
path: "**/*.jar"