Skip to content

java linux snippets #273

java linux snippets

java linux snippets #273

name: java linux snippets
on:
push:
branches-ignore: [main]
pull_request:
branches: [main]
schedule:
- cron: "15 7 * * *"
permissions:
contents: read
jobs:
java-linux-snippets:
outputs:
status: ${{ job.status }}
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java-version: ["17", "21"]
java-distribution: ["temurin"]
steps:
- name: checkout repository
uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: actions/setup-java@v5
with:
java-version: ${{ matrix.java-version }}
distribution: ${{ matrix.java-distribution }}
- name: install Senzing runtime
uses: senzing-factory/github-action-install-senzing-sdk@v3
with:
packages-to-install: "senzingsdk-runtime senzingsdk-setup"
senzingsdk-repository-package: ${{ secrets.SENZING_APT_BETA_STAGING_REPOSITORY_PACKAGE }}
senzingsdk-repository-path: ${{ secrets.SENZING_APT_BETA_STAGING_REPOSITORY_URL }}
- name: build with Maven
env:
SENZING_PATH: "/opt/senzing"
run: |
cd "${GITHUB_WORKSPACE}"/java
mvn clean install -Pcheckstyle,spotbugs -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
- name: run java snippets
env:
LD_LIBRARY_PATH: "/opt/senzing/er/lib:${LD_LIBRARY_PATH}"
run: |
cd "${GITHUB_WORKSPACE}"/java
java -jar target/sz-sdk-snippets.jar all
slack-notification:
needs: [java-linux-snippets]
if: ${{ always() && contains(fromJSON('["failure", "cancelled"]'), needs.java-linux-snippets.outputs.status ) && github.event_name == 'schedule' }}
secrets:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
uses: senzing-factory/build-resources/.github/workflows/build-failure-slack-notification.yaml@v2
with:
job-status: ${{ needs.java-linux-snippets.outputs.status }}