-
Notifications
You must be signed in to change notification settings - Fork 124
113 lines (91 loc) · 2.88 KB
/
Copy pathmaven.yml
File metadata and controls
113 lines (91 loc) · 2.88 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: Maven Build and Deployment
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
name: Java 11 Build and Verify
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Set up Java and Maven
uses: actions/setup-java@v1
with:
java-version: 11
- name: Add OSSRH to the snapshot repositories list
uses: s4u/maven-settings-action@v2.1.0
with:
sonatypeSnapshots: true
- name: Cache Maven packages
uses: actions/cache@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
- name: Build with Maven
run: mvn -B verify
- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v1
compatibility-checks:
name: Java ${{ matrix.java }} on ${{ matrix.os }} Compatibility
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
java: [8, 11, 16]
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Set up Java and Maven
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: Add OSSRH to the snapshot repositories list
uses: s4u/maven-settings-action@v2.1.0
with:
sonatypeSnapshots: true
- name: Cache Maven packages
uses: actions/cache@v1
with:
path: ~/.m2
key: ${{ runner.os }}-${{ matrix.java }}-m2-${{ hashFiles('**/pom.xml') }}
- name: Test with Maven
run: mvn -B test
- name: Upload Surefire reports on test failure
uses: actions/upload-artifact@v1
if: failure()
with:
name: surefire-test-log
path: target/surefire-reports
deploy:
name: Deploy to OSSRH
needs: [build, compatibility-checks]
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Set up Java and Maven
uses: actions/setup-java@v1
with:
# Java version 8 required due to https://github.com/lmdbjava/lmdbjava/issues/116
java-version: 8
- name: Add OSSRH to the snapshot repositories list
uses: s4u/maven-settings-action@v2.1.0
with:
sonatypeSnapshots: true
- name: Cache Maven packages
uses: actions/cache@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
- name: Publish Maven package
uses: samuelmeuli/action-maven-publish@v1
with:
gpg_private_key: ${{ secrets.gpg_private_key }}
gpg_passphrase: ${{ secrets.gpg_passphrase }}
nexus_username: ${{ secrets.nexus_username }}
nexus_password: ${{ secrets.nexus_password }}
maven_profiles: ossrh-deploy