File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3232 ${{ runner.os }}-maven-
3333
3434 - name : Set env variables
35- run : echo "tag=${{ github.ref_name }}" >> $GITHUB_ENV
35+ run : echo "tag=${{ github.ref_name }}" >> $GITHUB_ENV
3636
3737 - name : Download and unzip SDK JAR file
3838 run : |
5252 mvn package
5353 # run: mvn clean install -DskipTests
5454
55+ - name : Run tests
56+ run : chmod +x test.sh && ./test.sh
57+
5558 - name : Prepare files for release
5659 id : prepare-for-release
5760 run : |
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # This is local jar test during build and push action.
4+
5+ # Colors for output into console
6+ GREEN=' \033[0;32m'
7+ RED=' \033[0;31m'
8+ PURPLE=' \033[0;35m'
9+ NC=' \033[0m' # No Color
10+
11+ # Function to print info messages
12+ info () { echo -e " ${PURPLE} $1 ${NC} " ; }
13+
14+ # Function to print success messages
15+ success () { echo -e " ${GREEN} $1 ${NC} " ; }
16+
17+ # Function to print error messages
18+ error () { echo -e " ${RED} ERROR: $1 ${NC} " ; }
19+
20+ # init
21+ pushd " $( dirname $0 ) " > /dev/null
22+
23+ EXIT_STATUS=0
24+
25+ info " List files in target directory"
26+ ls -l $( pwd) /target
27+
28+ info " Test #01: Show help"
29+ java -jar target/net.pdfix.validate-pdf-* .jar --help > /dev/null
30+ if [ $? -eq 0 ]; then
31+ success " passed"
32+ else
33+ error " Failed to run \" --help\" command"
34+ EXIT_STATUS=1
35+ fi
36+
37+ info " Test #02: Run validate MCID"
38+ OUTPUT=$( java -jar target/net.pdfix.validate-pdf-* .jar duplicate-mcid -i resources/test.pdf)
39+ COUNT=$( echo " $OUTPUT " | grep -c " Duplicate MCID Found" )
40+ info " $OUTPUT "
41+ if [ " $COUNT " -eq 5 ]; then
42+ success " passed"
43+ else
44+ error " Validate MCID failed on resources/test.pdf. Expected 5 duplicate MCIDs, found $COUNT ."
45+ EXIT_STATUS=1
46+ fi
47+
48+ popd > /dev/null
49+
50+ if [ $EXIT_STATUS -eq 1 ]; then
51+ error " One or more tests failed."
52+ exit 1
53+ else
54+ success " All tests passed."
55+ exit 0
56+ fi
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ version_short="${1#v}"
2929echo " Version: $1 "
3030echo " Short version: ${version_short} "
3131
32+ # Update the version in pom.xml
3233mvn versions:set -DnewVersion=${version_short}
3334
3435# Replace "v0.0.0" placeholder with the provided argument in config.json
You can’t perform that action at this time.
0 commit comments