Browse Source

Add Travis CI integration (#162)

* Add Travis integration
* Improve Travis build_examples script
* Use local unipdf package when building examples
master
Adrian-George Bostan 1 year ago
committed by Gunnsteinn Hall
parent
commit
7406957200
2 changed files with 48 additions and 0 deletions
  1. +35
    -0
      .travis.yml
  2. +13
    -0
      .travis/build_examples.sh

+ 35
- 0
.travis.yml View File

@ -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
- 0
.travis/build_examples.sh View File

@ -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

Loading…
Cancel
Save