1
0
mirror of https://github.com/MontFerret/ferret.git synced 2024-12-14 11:23:02 +02:00
ferret/.travis.yml
2019-08-29 14:54:06 -04:00

72 lines
1.4 KiB
YAML

language: go
sudo: required
os:
- linux
go:
- "1.11.x"
- "1.12.x"
- stable
services:
- docker
addons:
apt:
packages:
- openjdk-9-jre-headless
install:
- go get -u github.com/mgechev/revive
- go get -u github.com/golangci/golangci-lint/cmd/golangci-lint
- sudo curl -o /usr/local/lib/antlr-4.7.1-complete.jar https://www.antlr.org/download/antlr-4.7.1-complete.jar
- export CLASSPATH=".:/usr/local/lib/antlr-4.7.1-complete.jar:$CLASSPATH"
- mkdir $HOME/travis-bin
- echo -e '#!/bin/bash\njava -jar /usr/local/lib/antlr-4.7.1-complete.jar "$@"' > $HOME/travis-bin/antlr
- echo -e '#!/bin/bash\njava org.antlr.v4.gui.TestRig "$@"' > $HOME/travis-bin/grun
- chmod +x $HOME/travis-bin/*
- export PATH=$PATH:$HOME/travis-bin
- export GO111MODULE=on
stages:
- lint
- compile
- test
- e2e
- bench
jobs:
include:
- stage: lint
go: stable
script:
- make vet
- make lint
- make fmt
- git diff
- if [[ $(git diff) != '' ]]; then echo 'Invalid formatting!' >&2; exit 1; fi
- stage: compile
go: stable
script:
- make generate
- make compile
- stage: test
script:
- make cover
- stage: e2e
go: stable
before_script:
- docker pull microbox/chromium-headless:75.0.3765.1
- docker run -d -p 9222:9222 microbox/chromium-headless:75.0.3765.1
- docker ps
script:
- make e2e
after_script:
- docker stop $(docker ps -q)
- stage: bench
go: stable
script:
- make bench