forked from Nerzal/gocloak
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
40 lines (35 loc) · 1.12 KB
/
.travis.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
language: go
services:
- docker
branches:
only:
- master
- /^v\d+\.\d+(\.\d+)?$/
stages:
- style
- test
- goreportcard
jobs:
include:
- stage: style
name: "gofmt"
script: diff -u <(echo -n) <(gofmt -d -s .)
- name: "golint"
install: go get -u golang.org/x/lint/golint
script: golint -set_exit_status ./...
- name: "govet"
script: go vet ./...
- stage: test
before_install:
- docker pull quay.io/keycloak/keycloak
- docker run -d -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=secret -e KEYCLOAK_IMPORT=/tmp/gocloak-realm.json -v `pwd`/testdata/gocloak-realm.json:/tmp/gocloak-realm.json -p 8080:8080 --name keycloak quay.io/keycloak/keycloak
script:
- go test -cover -v -race -coverprofile=coverage.txt -covermode=atomic
after_success:
- bash <(curl -s https://codecov.io/bash)
after_failure:
- docker ps
- docker logs keycloak
- stage: goreportcard
script: curl --fail --request POST "https://goreportcard.com/checks" --data "repo=github.com/Nerzal/gocloak"
if: branch = master AND type = push