Skip to content

Commit fab17d9

Browse files
committed
Adding github actions for PR-build and merge-build
1 parent 1eb43f3 commit fab17d9

2 files changed

Lines changed: 78 additions & 0 deletions

File tree

.github/workflows/merge-build.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# This workflow will build a Java project with Maven
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
3+
4+
name: Merge / Push Build
5+
6+
on: [push]
7+
8+
jobs:
9+
build-on-push:
10+
11+
runs-on: ubuntu-latest
12+
13+
permissions:
14+
contents: read
15+
packages: write
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
20+
- name: Set up cache for ~./m2/repository
21+
uses: actions/cache@v2.1.1
22+
with:
23+
path: ~/.m2/repository
24+
key: maven-${{ hashFiles('**/pom.xml') }}
25+
restore-keys: |
26+
maven-
27+
28+
- name: Set up JDK
29+
uses: actions/setup-java@v2
30+
with:
31+
java-version: '8'
32+
distribution: 'adopt'
33+
34+
- name: maven-settings-xml-action
35+
uses: whelk-io/maven-settings-xml-action@v14
36+
if: ${{ github.event.repository.fork == false }}
37+
with:
38+
repositories: '[{ "id": "sonatype", "url": "https://oss.sonatype.org/content/repositories/snapshots/", "releases": {"enabled": "false"}, "snapshots": {"enabled": "true" }}]'
39+
servers: '[{ "id": "sonatype", "username": "${{ secrets.SONATYPE_BOT_USERNAME}}", "password": "${{ secrets.SONATYPE_BOT_TOKEN}}" }]'
40+
41+
- name: "Maven Build"
42+
run: mvn -B -e verify

.github/workflows/pr-build.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# This workflow will build a Java project with Maven
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
3+
4+
name: PR Build
5+
6+
on: [pull_request]
7+
8+
jobs:
9+
build:
10+
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- name: Set up cache for ~./m2/repository
17+
uses: actions/cache@v2.1.1
18+
with:
19+
path: ~/.m2/repository
20+
key: maven-${{ hashFiles('**/pom.xml') }}
21+
restore-keys: |
22+
maven-
23+
24+
- name: Set up JDK
25+
uses: actions/setup-java@v2
26+
with:
27+
java-version: '8'
28+
distribution: 'adopt'
29+
30+
- name: maven-settings-xml-action
31+
uses: whelk-io/maven-settings-xml-action@v14
32+
with:
33+
repositories: '[{ "id": "sonatype", "url": "https://oss.sonatype.org/content/repositories/snapshots/", "releases": {"enabled": "false"}, "snapshots": {"enabled": "true" }}]'
34+
35+
- name: Build with Maven
36+
run: mvn -B -e verify

0 commit comments

Comments
 (0)