Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test #41

Closed
wants to merge 15 commits into from
Closed

Test #41

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/test-dotnet-samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ jobs:
run: |
sample_name=$(basename "$PWD")



if [ "$sample_name" == "Redactions" ] && [ "${{matrix.os}}" == 'ubuntu-latest' ]; then
echo "Not available on this os"
else
Expand Down Expand Up @@ -194,3 +196,14 @@ jobs:
- name: List files
run: |
ls ${{matrix.dir}}

- name: Test
working-directory: ${{matrix.dir}}
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
cat bin/Release/net6.0/runtimes/win-x64/native/apdfl.lic
elif [ "$RUNNER_OS" == "Linux" ]; then
cat bin/Release/net6.0/runtimes/linux-x64/native/APDFL.lic
else
cat bin/Release/net6.0/runtimes/osx-arm64/native/apdfl.lic
fi
310 changes: 310 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,310 @@
name: test-staggered-workflow

on:
pull_request:
branches:
- develop
- main
push:
branches:
- develop
- main

env:
DOTNET_VERSION: '6.x'
MATRIX_DIR: |
[ "Annotations/Annotations/",
"Annotations/InkAnnotations/",
"Annotations/LinkAnnotation/",
"Annotations/PolygonAnnotations/",
"Annotations/PolyLineAnnotations/",
"ContentCreation/AddElements/",
"ContentCreation/AddHeaderFooter/",
"ContentCreation/Clips/",
"ContentCreation/CreateBookmarks/",
"ContentCreation/GradientShade/",
"ContentCreation/MakeDocWithCalGrayColorSpace/",
"ContentCreation/MakeDocWithCalRGBColorSpace/",
"ContentCreation/MakeDocWithDeviceNColorSpace/",
"ContentCreation/MakeDocWithICCBasedColorSpace/",
"ContentCreation/MakeDocWithIndexedColorSpace/",
"ContentCreation/MakeDocWithLabColorSpace/",
"ContentCreation/MakeDocWithSeparationColorSpace/",
"ContentCreation/NameTrees/",
"ContentCreation/NumberTrees/",
"ContentCreation/RemoteGoToActions/",
"ContentCreation/WriteNChannelTiff/",
"ContentModification/Action/",
"ContentModification/AddCollection/",
"ContentModification/AddQRCode/",
"ContentModification/ChangeLayerConfiguration/",
"ContentModification/ChangeLinkColors/",
"ContentModification/CreateLayer/",
"ContentModification/ExtendedGraphicStates/",
"ContentModification/FlattenTransparency/",
"ContentModification/LaunchActions/",
"ContentModification/MergePDF/",
"ContentModification/PageLabels/",
"ContentModification/PDFObject/",
"ContentModification/UnderlinesAndHighlights/",
"ContentModification/Watermark/",
"DocumentConversion/ColorConvertDocument/",
"DocumentConversion/ConvertToOffice/",
"DocumentConversion/CreateDocFromXPS/",
"DocumentConversion/Factur-XConverter/",
"DocumentConversion/PDFAConverter/",
"DocumentConversion/PDFXConverter/",
"DocumentConversion/ZUGFeRDConverter/",
"DocumentOptimization/PDFOptimize/",
"Images/DocToImages/",
"Images/DrawSeparations/",
"Images/DrawToBitmap/",
"Images/EPSSeparations/",
"Images/GetSeparatedImages/",
"Images/ImageEmbedICCProfile/",
"Images/ImageExport/",
"Images/ImageExtraction/",
"Images/ImageFromStream/",
"Images/ImageImport/",
"Images/ImageResampling/",
"Images/ImageSoftMask/",
"Images/OutputPreview/",
"Images/RasterizePage/",
"InformationExtraction/ListBookmarks/",
"InformationExtraction/ListInfo/",
"InformationExtraction/ListLayers/",
"InformationExtraction/ListPaths/",
"InformationExtraction/Metadata/",
"OpticalCharacterRecognition/AddTextToDocument/",
"OpticalCharacterRecognition/AddTextToImage/",
"Other/MemoryFileSystem/",
"Other/StreamIO/",
"Security/AddRegexRedaction/",
"Security/Redactions/",
"Text/AddGlyphs/",
"Text/AddUnicodeText/",
"Text/AddVerticalText/",
"Text/ExtractAcroFormFieldData/",
"Text/ExtractCJKTextByPatternMatch/",
"Text/ExtractTextByPatternMatch/",
"Text/ExtractTextByRegion/",
"Text/ExtractTextFromAnnotations/",
"Text/ExtractTextFromMultiRegions/",
"Text/ExtractTextPreservingStyleAndPositionInfo/",
"Text/ListWords/",
"Text/RegexExtractText/",
"Text/RegexTextSearch/",
"Text/TextExtract/"
]

jobs:
get-matrix-dir-from-env:
name: Get MATRIX_DIR
runs-on: windows-latest
outputs:
MATRIX_DIR: ${{ env.MATRIX_DIR }}
steps:
- name: Print message
run: echo "Set MATRIX_DIR environment variable as output"

run-samples-macos:
runs-on: macos-14
needs: [get-matrix-dir-from-env]
strategy:
matrix:
dir: ${{ fromJSON(needs.get-matrix-dir-from-env.outputs.MATRIX_DIR) }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Build samples
working-directory: ${{ matrix.dir }}
run: |
sample_name=$(basename "$PWD")
if [[ ("$sample_name" != "ConvertToOffice" && "$sample_name" != "CreateDocFromXPS") || "${{ matrix.os }}" != 'macos-14' ]]; then
dotnet build -c Release *.csproj
else
echo "Not available on this os"
fi

- name: Run samples
working-directory: ${{ matrix.dir }}
run: |
sample_name=$(basename "$PWD")
if [[ ("$sample_name" != "ConvertToOffice" && "$sample_name" != "CreateDocFromXPS") || "${{ matrix.os }}" != 'macos-14' ]]; then
if [[ "$sample_name" == "DocToImages" ]]; then
dotnet bin/Release/net6.0/$sample_name.dll -format=png $HOME/.nuget/packages/adobe.pdf.library.sampleinput/1.0.0/build/Resources/Sample_Input/ducky.pdf
else
dotnet bin/Release/net6.0/$sample_name.dll
fi
else
echo "Not available on this os"
fi

- name: Set sample_name variable
working-directory: ${{ matrix.dir }}
id: set-sample-name
run: echo "SAMPLE_NAME=$(basename "$PWD")" >> "$GITHUB_ENV"

- name: Save artifacts
uses: actions/upload-artifact@v4
with:
name: output-${{ runner.os }}-${{ env.SAMPLE_NAME }}
path: |
${{ matrix.dir }}/*.docx
${{ matrix.dir }}/*.xslx
${{ matrix.dir }}/*.pptx
${{ matrix.dir }}/*.pdf
${{ matrix.dir }}/*.tif
${{ matrix.dir }}/*.png
${{ matrix.dir }}/*.jpg
${{ matrix.dir }}/*.eps
${{ matrix.dir }}/*.tiff
${{ matrix.dir }}/*.bmp
${{ matrix.dir }}/*.gif
${{ matrix.dir }}/*.json
${{ matrix.dir }}/*.txt
${{ matrix.dir }}/*.csv

- name: List files
run: ls ${{ matrix.dir }}


run-samples-windows:
runs-on: windows-latest
needs: [get-matrix-dir-from-env, run-samples-macos]
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
dir: ${{ fromJSON(needs.get-matrix-dir-from-env.outputs.MATRIX_DIR) }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Build samples
working-directory: ${{ matrix.dir }}
run: |
dotnet build -c Release *.csproj

- name: Run samples
working-directory: ${{ matrix.dir }}
run: |
sample_name=$(basename "$PWD")
if [[ "$sample_name" == "DocToImages" ]]; then
bin/Release/net6.0/$sample_name.exe -format=png $HOME/.nuget/packages/adobe.pdf.library.sampleinput/1.0.0/build/Resources/Sample_Input/ducky.pdf
else
bin/Release/net6.0/$sample_name.exe
fi


- name: Set sample_name variable
working-directory: ${{ matrix.dir }}
id: set-sample-name
run: echo "SAMPLE_NAME=$(basename "$PWD")" >> "$GITHUB_ENV"

- name: Save artifacts
uses: actions/upload-artifact@v4
with:
name: output-${{ runner.os }}-${{ env.SAMPLE_NAME }}
path: |
${{ matrix.dir }}/*.docx
${{ matrix.dir }}/*.xslx
${{ matrix.dir }}/*.pptx
${{ matrix.dir }}/*.pdf
${{ matrix.dir }}/*.tif
${{ matrix.dir }}/*.png
${{ matrix.dir }}/*.jpg
${{ matrix.dir }}/*.eps
${{ matrix.dir }}/*.tiff
${{ matrix.dir }}/*.bmp
${{ matrix.dir }}/*.gif
${{ matrix.dir }}/*.json
${{ matrix.dir }}/*.txt
${{ matrix.dir }}/*.csv

- name: List files
run: ls ${{ matrix.dir }}

run-samples-ubuntu:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dir: ${{ fromJSON(vars.MATRIX_DIR) }}
needs: [run-samples-windows]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Setup Microsoft Core Fonts
run: |
sample_name=$(basename "$PWD")
case "$sample_name" in
"AddHeaderFooter" | "AddElements" | "MakeDocWithCalGrayColorSpace" | "MakeDocWithCalRGBColorSpace" | "MakeDocWithDeviceNColorSpace" | "MakeDocWithICCBasedColorSpace" | "MakeDocWithIndexedColorSpace" | "MakeDocWithLabColorSpace" | "MakeDocWithSeparationColorSpace" | "ExtendedGraphicStates" | "AddGlyphs" | "AddUnicodeText")
echo 'ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true' | sudo debconf-set-selections
sudo apt-get install -y ttf-mscorefonts-installer
;;
esac

- name: Build samples
working-directory: ${{ matrix.dir }}
run: |
dotnet build -c Release *.csproj

- name: Run samples
working-directory: ${{ matrix.dir }}
run: |
sample_name=$(basename "$PWD")
if [[ "$sample_name" == "Redactions" && "${{ matrix.os }}" == 'ubuntu-latest' ]]; then
echo "Not available on this os"
else
if [[ "$sample_name" == "DocToImages" ]]; then
dotnet bin/Release/net6.0/$sample_name.dll -format=png $HOME/.nuget/packages/adobe.pdf.library.sampleinput/1.0.0/build/Resources/Sample_Input/ducky.pdf
else
dotnet bin/Release/net6.0/$sample_name.dll
fi

- name: Set sample_name variable
id: set-sample-name
run: echo "SAMPLE_NAME=$(basename "$PWD")" >> "$GITHUB_ENV"

- name: Save artifacts
uses: actions/upload-artifact@v4
with:
name: output-${{ runner.os }}-${{ env.SAMPLE_NAME }}
path: |
${{ matrix.dir }}/*.docx
${{ matrix.dir }}/*.xslx
${{ matrix.dir }}/*.pptx
${{ matrix.dir }}/*.pdf
${{ matrix.dir }}/*.tif
${{ matrix.dir }}/*.png
${{ matrix.dir }}/*.jpg
${{ matrix.dir }}/*.eps
${{ matrix.dir }}/*.tiff
${{ matrix.dir }}/*.bmp
${{ matrix.dir }}/*.gif
${{ matrix.dir }}/*.json
${{ matrix.dir }}/*.txt
${{ matrix.dir }}/*.csv

- name: List files
run: ls ${{ matrix.dir }}
Loading