-
Notifications
You must be signed in to change notification settings - Fork 2
76 lines (64 loc) · 2.73 KB
/
verapdfcheck.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
name: verapdfcheck
on:
push:
branches:
- master
pull_request:
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Wait for main task to succeed
uses: fountainhead/action-wait-for-check@v1.2.0
id: wait-for-build
with:
token: ${{ secrets.GITHUB_TOKEN }}
checkName: ubuntu_build
ref: ${{ github.event.pull_request.head.sha || github.sha }}
timeoutSeconds: 7200
- name: Download workflow artifact
uses: dawidd6/action-download-artifact@v6
with:
workflow: ubuntu.yml
workflow_conclusion: success
commit: ${{github.event.pull_request.head.sha}}
name: published-ubuntu
- name: Run Docker image veraPDF
run: |
docker pull verapdf/rest:latest
docker run -d -p 8080:8080 -p 8081:8081 -v ./:/home/folder verapdf/rest:latest
- name: Wait for a Docker container to be up and running
run: |
timeout 20s sh -c 'until curl http://localhost:8080/api/ | grep -q verapdf-rest; do echo "Waiting until container to be healthy..."; sleep 1; done'
- name: Check PDFs for PDF/A-3a using veraPDF
run: |
find ./ -type f -name "*.pdf" -exec curl -F "file=@{}" localhost:8080/api/validate/3a -H "Accept:application/xml" -o "{}.verapdf.3a.report.xml" \;
- name: List files
run: |
find ./ -type f -name "*.verapdf.3a.report.xml"
- name: Check veraPDF PDF/A-3a XML reports on errors
run: |
err_files_name=err.files.3a.txt
[ -e $err_files_name ] && rm $err_files_name
for f in $(find ./ -type f -name '*.verapdf.3a.report.xml'); do grep -l 'status=\"failed\"' $f >> $err_files_name && cat $f; done
if [ -s $err_files_name ]; then
echo "veraPDF found PDF/A-3a errors:"
cat $err_files_name
exit 1
fi
- name: Check PDFs for PDF/UA-1 using veraPDF
run: |
find ./ -type f -name "*.pdf" -exec curl -F "file=@{}" localhost:8080/api/validate/ua1 -H "Accept:application/xml" -o "{}.verapdf.ua1.report.xml" \;
- name: List files
run: |
find ./ -type f -name "*.verapdf.ua1.report.xml"
- name: Check veraPDF PDF/UA-1 XML reports on errors
run: |
err_files_name=err.files.ua1.txt
[ -e $err_files_name ] && rm $err_files_name
for f in $(find ./ -type f -name '*.verapdf.ua1.report.xml'); do grep -l 'status=\"failed\"' $f >> $err_files_name && cat $f; done
if [ -s $err_files_name ]; then
echo "veraPDF found PDF/UA-1 errors:"
cat $err_files_name
exit 1
fi