Add MergePDF Kotlin sample #47
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', 'FlattenTransparency', 'SplitPDF', 'ConvertToOffice', 'MergePDF'] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
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: Set up Windows system PATH | |
working-directory: ${{ matrix.dir }} | |
run: | | |
if [ "$RUNNER_OS" == "Windows" ]; then | |
echo "${{ github.workspace }}\${{ matrix.dir }}\target\lib" >> $GITHUB_PATH | |
fi | |
- name: Run samples | |
working-directory: ${{ matrix.dir }} | |
run: | | |
if [ "$RUNNER_OS" == "Windows" ]; then | |
java -Djava.library.path="$PATH" -Dfile.encoding=UTF-8 -jar target/${{ matrix.dir }}-1.0-SNAPSHOT-jar-with-dependencies.jar | |
elif [ "$RUNNER_OS" == "Linux" ]; then | |
java -Djava.library.path=./target/lib -Dfile.encoding=UTF-8 -jar target/${{ matrix.dir }}-1.0-SNAPSHOT-jar-with-dependencies.jar | |
fi | |
- name: List files | |
run: | | |
ls ${{matrix.dir}} | |
- name: Save artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: sample-output-${{ runner.os }}-${{matrix.dir}} | |
path: | | |
${{matrix.dir}}/*.txt | |
${{matrix.dir}}/*.pdf | |
${{matrix.dir}}/*.docx | |
${{matrix.dir}}/*.xlsx | |
${{matrix.dir}}/*.pptx |