Skip to content

Expand GitHub Actions workflow to build and run Kotlin samples in CI #10

Expand GitHub Actions workflow to build and run Kotlin samples in CI

Expand GitHub Actions workflow to build and run Kotlin samples in CI #10

name: test-kotlin-samples-with-java-maven-package
on:
pull_request:
push:
branches: [ develop ]
env:
JAVA_VERSION: '11'
jobs:
build-and-run-samples:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
dir: ['TextExtract']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v2
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'adopt'
- name: Clean target folder
working-directory: ${{ matrix.dir }}
run: mvn -e clean
- name: Unpack APDFL from Maven Central
working-directory: ${{ matrix.dir }}
run: mvn -e process-resources
- name: Compile and assemble sample JAR files with dependencies
working-directory: ${{ matrix.dir }}
run: mvn -e package
- name: Run samples
working-directory: ${{ matrix.dir }}
run: java -Djava.library.path=./target/lib -Dfile.encoding=UTF-8 -jar target/${{ matrix.dir }}-1.0-SNAPSHOT-jar-with-dependencies.jar
- name: List files
run: |
ls ${{ github.workspace }}/target/lib