before_script: - go version stages: - test - deploy Unit tests: stage: test except: - /^[0-9]+\./ tags: - golang - mongo # Require an available mongo service - strong # Disable this build on small runners services: - "lesterpig/mongo:latest" # Use this light version of mongo - "lesterpig/postfix:latest" artifacts: paths: - "coverage.html" script: - "ln -s $(pwd) $GOPATH/src/dfss" - "./build/deps.sh" - "cd $GOPATH/src/dfss && make install" - "go test -coverprofile auth.part -v dfss/auth" - "go test -coverprofile mgdb.part -v dfss/mgdb" - "go test -coverprofile mails.part -v dfss/mails" - "go test -coverprofile net.part -v dfss/net" - "go test -coverprofile dfssp_authority.part -v dfss/dfssp/authority" - "go test -coverprofile dfssp_user.part -v dfss/dfssp/user" - "go test -coverprofile dfssp_contract.part -v dfss/dfssp/contract" - "go test -coverprofile dfssp_templates.part -v dfss/dfssp/templates" - "go test -coverprofile dfssp_common.part -v dfss/dfssp/common" - "go test -coverprofile dfssc_common.part -v dfss/dfssc/common" - "go test -coverprofile dfssc_security.part -v dfss/dfssc/security" - "go test -coverprofile dfssc_user.part -v dfss/dfssc/user" - "go test -coverprofile dfssc_user.part -v dfss/dfssc/sign" - "echo 'mode: set' *part > c.out" - "grep -h -v 'mode: set' *part >> c.out" - "go tool cover -html=c.out -o coverage.html" Integration tests: stage: test except: - /^[0-9]+\./ tags: - golang - mongo - goqt services: - "lesterpig/mongo:latest" script: - "ln -s -f $(pwd) $GOPATH/src/dfss" - "./build/deps.sh" - "cd $GOPATH/src/dfss && make install" # Copy required files - "cp $GOPATH/src/github.com/visualfc/goqt/bin/* $GOPATH/src/dfss/dfssd/" # Build ressources - "cd $GOPATH/src/dfss/dfssd/gui && ../goqt_rcc -go gui -o application.qrc.go application.qrc" # Build binary - "cd $GOPATH/src/dfss/dfssd && go build -ldflags \"-r .\" -o dfssd" # Install binary - "cp $GOPATH/src/dfss/dfssd/dfssd $GOPATH/bin/" - "cp $GOPATH/src/dfss/dfssd/libqtdrv.ui.so.1 /lib/" # Start integration tests - "go test -v dfss/tests" Code lint: stage: test except: - /^[0-9]+\./ allow_failure: True tags: - golang - lint script: - "ln -s $(pwd) $GOPATH/src/dfss" - "go get -u github.com/alecthomas/gometalinter" - "./build/deps.sh" - "cd $GOPATH/src/dfss && make install_all" - "gometalinter --install --update" - "gometalinter -t --deadline=600s -j1 --skip=api --skip=fixtures --skip=gui --skip=dfssd --disable=aligncheck ./..." Deploy: stage: deploy only: - /^v[0-9]/ - master tags: - golang - strong - goqt - deploy script: - "ln -s -f $(pwd) $GOPATH/src/dfss" - "./build/deps.sh" - "make release" - "make deploy"