Skip to content

Update dependencies and plugins #99

Update dependencies and plugins

Update dependencies and plugins #99

# 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://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: NetLicensing Client - CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
build:
runs-on: [self-hosted]
container: maven:3.8.6-openjdk-17
env:
# This is needed, as java doesn't respect the environment variable $HOME, but gets the
# user home by other means from the system. The default user in the above container is
# 'root' with the home at '/root', while GitHub runner overrides $HOME to the mounted
# '/github/home'. As a result, maven uses the ~/.m2 at a different location than assumed
# by the standard GitHub actions like 'actions/setup-java', causing caching of the maven
# local repository not working.
# TODO(2K): This can be better solved by preparing a custom image for the container.
MAVEN_OPTS: -Duser.home=/github/home
strategy:
matrix:
java-version: [11, 17]
steps:
- uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java-version }}
distribution: 'adopt'
cache: maven
- name: Build with Maven
run: mvn -B clean verify
- name: Run Demo App
run: |
ls -la NetLicensingClient-demo/target/
java -jar NetLicensingClient-demo/target/netlicensing-client-demo.jar -r CallEveryAPIMethod