Skip to content
Merged
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
35 changes: 35 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
language: go
sudo: required
go:
- 1.12.x
env:
global:
- CGO_ENABLED="0"
- GO111MODULE="on"
- TMPDIR="$(echo -n $HOME/tmp)"
- UNIDOC_GS_BIN_PATH="/usr/bin/gs"
- UNIDOC_EXTRACT_FORCETEST="0"
- UNIDOC_E2E_FORCE_TESTS="0"
- UNIDOC_EXTRACT_TESTDATA=""
- UNIDOC_RENDERTEST_BASELINE_PATH=""
- UNIDOC_PASSTHROUGH_TESTDATA=""
- UNIDOC_ALLOBJECTS_TESTDATA=""
- UNIDOC_SPLIT_TESTDATA=""
- UNIDOC_EXTRACT_IMAGES_TESTDATA=""
- UNIDOC_JBIG2_TESTDATA=""
- UNIDOC_FDFMERGE_TESTDATA=""
before_install:
- sudo apt-get update
- sudo apt-get install -y git ghostscript
- go get golang.org/x/lint/golint
- go get -t ./...
- mkdir -p $TMPDIR
script:
- go vet ./...
- golint ./...
- go test -v ./...
- find $TMPDIR -maxdepth 1 -name "*.pdf" -print0 | xargs -t -n 1 -0 gs -dNOPAUSE -dBATCH -sDEVICE=nullpage -sPDFPassword=password -dPDFSTOPONERROR -dPDFSTOPONWARNING
- go test -coverprofile=coverage.out -covermode=atomic -coverpkg=./... ./...
- ./.travis/build_examples.sh
after_success:
- bash <(curl -s https://codecov.io/bash)
13 changes: 13 additions & 0 deletions .travis/build_examples.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
repo_path="$HOME/projects/unipdf-examples"
git clone https://github.com/unidoc/unipdf-examples.git $repo_path
cd $repo_path

branch_name="v3"
if [[ `git ls-remote origin "$TRAVIS_BRANCH"` ]]; then
branch_name="$TRAVIS_BRANCH"
fi

git checkout $branch_name
echo "replace github.com/unidoc/unipdf/v3 => $TRAVIS_BUILD_DIR" >> go.mod
./build_examples.sh