Skip to content

Commit 0166eb4

Browse files
authored
Add GitHub actions for testing (#305)
* Add GitHub actions for testing Signed-off-by: Sven Strickroth <email@cs-ware.de> * Store artifacts Signed-off-by: Sven Strickroth <email@cs-ware.de> * Only store one artifact Signed-off-by: Sven Strickroth <email@cs-ware.de> --------- Signed-off-by: Sven Strickroth <email@cs-ware.de>
1 parent e4e82ff commit 0166eb4

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

.github/workflows/maven.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
3+
4+
name: Java CI with Maven
5+
6+
on:
7+
push:
8+
paths-ignore:
9+
- '.github/workflows/*.yml'
10+
- '!.github/workflows/maven.yml'
11+
pull_request:
12+
paths-ignore:
13+
- '.github/workflows/*.yml'
14+
- '!.github/workflows/maven.yml'
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
build:
21+
runs-on: ubuntu-latest
22+
23+
strategy:
24+
matrix:
25+
java: [ '11', '17', '21' ]
26+
27+
steps:
28+
- uses: actions/checkout@v4
29+
- name: Set up JDK ${{ matrix.Java }}
30+
uses: actions/setup-java@v4
31+
with:
32+
java-version: ${{ matrix.Java }}
33+
distribution: 'temurin'
34+
cache: maven
35+
- name: Build with Maven
36+
run: mvn --batch-mode --errors --fail-at-end --show-version --update-snapshots verify
37+
- name: Store artifact
38+
if: ${{ matrix.Java == 11 }}
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: jar-jdk${{ matrix.Java }}
42+
path: target/*.jar
43+
retention-days: 7

0 commit comments

Comments
 (0)