Skip to content

Commit

Permalink
Add GitHub actions for testing (#305)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
csware authored Feb 2, 2024
1 parent e4e82ff commit 0166eb4
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven

name: Java CI with Maven

on:
push:
paths-ignore:
- '.github/workflows/*.yml'
- '!.github/workflows/maven.yml'
pull_request:
paths-ignore:
- '.github/workflows/*.yml'
- '!.github/workflows/maven.yml'

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
java: [ '11', '17', '21' ]

steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.Java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.Java }}
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn --batch-mode --errors --fail-at-end --show-version --update-snapshots verify
- name: Store artifact
if: ${{ matrix.Java == 11 }}
uses: actions/upload-artifact@v4
with:
name: jar-jdk${{ matrix.Java }}
path: target/*.jar
retention-days: 7

1 comment on commit 0166eb4

@csware
Copy link
Contributor Author

@csware csware commented on 0166eb4 Feb 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mikesamuel Shall we drop travis? I have a branch for that.... We could also add a badge for GitHub actions...

Please sign in to comment.