update travis

- Build and test
- Github release
- Build and push image
- Build and push image (tagged)*
This commit is contained in:
olumuyiwadad 2021-09-27 10:48:13 +05:30
parent 7d08fa95ba
commit 545fff8f8e

View file

@ -1,81 +1,110 @@
sudo: required
language: go
go_import_path: github.com/XinFinOrg/XDPoSChain
sudo: false
env:
global:
- GOPROXY=https://proxy.golang.org
- GO111MODULE=on
jobs:
include:
# This builder only tests code linters on latest version of Go
- stage: lint
os: linux
dist: bionic
go: 1.14.x
env:
- lint
git:
submodules: false # avoid cloning ethereum/tests
- stage: Lint
sudo: false
go: '1.12.x'
git:
submodules: false
script:
- go run build/ci.go lint
- stage: Tests
os: linux
dist: bionic
go: 1.14.x
env:
- GO111MODULE=auto
name: A-B tests
script: travis_retry go run build/ci.go test -coverage $(go list ./... | grep "github.com\/ethereum\/go-ethereum\/[a-b].*")
- script: travis_retry go run build/ci.go test -coverage $(go list ./... | grep "github.com\/ethereum\/go-ethereum\/c[a-m].*")
os: linux
dist: bionic
go: 1.14.x
env:
- GO111MODULE=auto
name: C-[a-m] tests
- script: travis_retry go run build/ci.go test -coverage $(go list ./... | grep "github.com\/ethereum\/go-ethereum\/c[n-o].*")
os: linux
dist: bionic
go: 1.14.x
env:
- GO111MODULE=auto
name: C-[n-o] tests
- script: travis_retry go run build/ci.go test -coverage $(go list ./... | grep "github.com\/ethereum\/go-ethereum\/c[p-z].*")
os: linux
dist: bionic
go: 1.14.x
env:
- GO111MODULE=auto
name: C-[p-z] tests
- script: travis_retry go run build/ci.go test -coverage $(go list ./... | grep "github.com\/ethereum\/go-ethereum\/[d-i].*")
os: linux
dist: bionic
go: 1.14.x
env:
- GO111MODULE=auto
name: D-I tests
- script: travis_retry go run build/ci.go test -coverage $(go list ./... | grep "github.com\/ethereum\/go-ethereum\/[j-n].*")
os: linux
dist: bionic
go: 1.14.x
env:
- GO111MODULE=auto
name: J-N tests
- script: travis_retry go run build/ci.go test -coverage $(go list ./... | grep "github.com\/ethereum\/go-ethereum\/[o-r].*")
os: linux
dist: bionic
go: 1.14.x
env:
- GO111MODULE=auto
name: O-R tests
- script: travis_retry go run build/ci.go test -v -coverage $(go list ./... | grep "github.com\/ethereum\/go-ethereum\/s.*")
os: linux
dist: bionic
go: 1.14.x
env:
- GO111MODULE=auto
name: S tests
- script: travis_retry go run build/ci.go test -coverage $(go list ./... | grep "github.com\/ethereum\/go-ethereum\/[t-z].*")
os: linux
dist: bionic
go: 1.14.x
env:
- GO111MODULE=auto
name: T-Z tests
- stage: Build and test
go: '1.12.x'
script:
- sudo modprobe fuse
- sudo chmod 666 /dev/fuse
- sudo chown root:$USER /etc/fuse.conf
- go run build/ci.go install
- while sleep 540; do echo "[ still running ]"; done &
- go run build/ci.go test -coverage
- kill %1
after_success:
- bash <(curl -s https://codecov.io/bash)
- go: '1.11.x'
script:
- sudo modprobe fuse
- sudo chmod 666 /dev/fuse
- sudo chown root:$USER /etc/fuse.conf
- go run build/ci.go install
- while sleep 540; do echo "[ still running ]"; done &
- go run build/ci.go test -coverage
- kill %1
- stage: Github release
go: '1.12.x'
script:
- GOARCH=amd64 GOOS=linux go build -o ./build/bin/XDC-linux-amd64 -v ./cmd/XDC
deploy:
provider: releases
api_key: $GITHUB_TOKEN
overwrite: true
file_glob: true
file: build/bin/XDC-*
skip_cleanup: true
on:
tags: true
- stage: Build and push image
services:
- docker
install: skip
before_script:
- docker build -t XinFinOrg/XDPoSChain .
- docker build -t XinFinOrg/node -f Dockerfile.node .
script:
- echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin
- docker tag XinFinOrg/XDPoSChain XinFinOrg/XDPoSChain:latest
- docker push XinFinOrg/XDPoSChain:latest
- docker tag XinFinOrg/XDPoSChain XinFinOrg/XDPoSChain:$TRAVIS_BUILD_ID
- docker push XinFinOrg/XDPoSChain:$TRAVIS_BUILD_ID
- docker tag XinFinOrg/node XinFinOrg/node:latest
- docker push XinFinOrg/node:latest
- docker tag XinFinOrg/node XinFinOrg/node:$TRAVIS_BUILD_ID
- docker push XinFinOrg/node:$TRAVIS_BUILD_ID
- stage: Build and push image (tagged)
services:
- docker
install: skip
before_script:
- docker build -t XinFinOrg/XDPoSChain .
- docker build -t XinFinOrg/XDPoSChain -f Dockerfile.node .
script:
- echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin
- docker tag XinFinOrg/XDPoSChain XinFinOrg/XDPoSChain:latest
- docker push XinFinOrg/XDPoSChain:latest
- docker tag XinFinOrg/XDPoSChain XinFinOrg/XDPoSChain:$TRAVIS_TAG
- docker push XinFinOrg/XDPoSChain:$TRAVIS_TAG
- docker tag XinFinOrg/XDPoSChain XinFinOrg/node:latest
- docker push XinFinOrg/node:latest
- docker tag XinFinOrg/node XinFinOrg/node:$TRAVIS_TAG
- docker push XinFinOrg/node:$TRAVIS_TAG
stages:
- name: Lint
- name: Build and test
- name: Github release
if: type != pull_request AND branch =~ ^v AND tag IS present AND repo = XinFinOrg/XDPoSChain
- name: Build and push image
if: type != pull_request AND branch = master AND tag IS blank AND repo = XinFinOrg/XDPoSChain
- name: Build and push image (tagged)
if: type != pull_request AND branch =~ ^v AND tag IS present AND repo = XinFinOrg/XDPoSChain
notifications:
slack:
rooms:
secure:
on_success: change
on_failure: always