Skip to content

Commit a77822e

Browse files
committed
Add Github workflow for building
1 parent d0df4c7 commit a77822e

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

.github/workflows/main.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Build and Deploy Snapshot
2+
on:
3+
push:
4+
branches:
5+
- master
6+
paths-ignore:
7+
- "README.md"
8+
- "release-notes/*"
9+
pull_request:
10+
branches:
11+
- master
12+
jobs:
13+
build:
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
java_version: ['8', '11', '17']
19+
os: ['ubuntu-20.04']
20+
env:
21+
JAVA_OPTS: "-XX:+TieredCompilation -XX:TieredStopAtLevel=1"
22+
steps:
23+
- uses: actions/checkout@v3
24+
- name: Set up JDK
25+
uses: actions/setup-java@v3
26+
with:
27+
distribution: 'temurin'
28+
java-version: ${{ matrix.java_version }}
29+
server-id: sonatype-nexus-snapshots
30+
server-username: CI_DEPLOY_USERNAME
31+
server-password: CI_DEPLOY_PASSWORD
32+
cache: 'maven'
33+
# See https://github.com/actions/setup-java/blob/v2/docs/advanced-usage.md#Publishing-using-Apache-Maven
34+
# gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
35+
# gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
36+
- name: Build
37+
run: ./mvnw -V -B -ff -ntp verify
38+
- name: Deploy snapshot
39+
if: github.event_name != 'pull_request' && matrix.java_version == '8'
40+
env:
41+
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
42+
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}
43+
# MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
44+
run: ./mvnw -B -ff -DskipTests -ntp source:jar deploy
45+
- name: Generate code coverage
46+
if: github.event_name != 'pull_request' && matrix.java_version == '8'
47+
run: ./mvnw -B -ff -ntp test
48+
- name: Publish code coverage
49+
if: github.event_name != 'pull_request' && matrix.java_version == '8'
50+
uses: codecov/codecov-action@v1
51+
with:
52+
token: ${{ secrets.CODECOV_TOKEN }}
53+
file: ./target/site/jacoco/jacoco.xml
54+
flags: unittests

0 commit comments

Comments
 (0)