-
Notifications
You must be signed in to change notification settings - Fork 9
307 lines (281 loc) · 10.4 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
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-windows:
runs-on: windows-latest
needs: [get-matrix-dir-from-env]
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
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 }}
run-samples-macos:
runs-on: macos-14
strategy:
matrix:
dir: ${{ fromJSON(vars.MATRIX_DIR) }}
needs: [run-samples-ubuntu]
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
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 }}