From a063987ba4bfed452a87c84a6d4a299fbe16b76a Mon Sep 17 00:00:00 2001 From: Artem Navoiev Date: Sun, 8 Sep 2019 14:50:30 +0300 Subject: [PATCH] [ci] use github actions --- .github/workflows/main.yml | 32 ++++++++++++++++++++++++++++++++ .travis.yml | 20 -------------------- README.md | 2 +- 3 files changed, 33 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/main.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..d5fc320 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,32 @@ +name: main +on: + - push +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: Setup Go + uses: actions/setup-go@v1 + with: + go-version: 1.13 + id: go + - name: Code checkout + uses: actions/checkout@v1 + - name: Test + run: | + go test -v ./... -coverprofile=coverage.txt -covermode=atomic + go test -v ./... -race + - name: Build + run: | + GOOS=linux go build + GOOS=darwin go build + GOOS=freebsd go build + GOOS=windows go build + GOARCH=386 go build + - name: Publish coverage + uses: codecov/codecov-action@v1.0.0 + with: + token: ${{secrets.CODECOV_TOKEN}} + file: ./coverage.txt + diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 39d07e6..0000000 --- a/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -language: go - -go: - - 1.12.x - -script: - # build test for supported platforms - - GOOS=linux go build - - GOOS=darwin go build - - GOOS=freebsd go build - - GOOS=windows go build - - GOARCH=386 go build - - # run tests on a standard platform - - go test -v ./... -coverprofile=coverage.txt -covermode=atomic - - go test -v ./... -race - -after_success: - # Upload coverage results to codecov.io - - bash <(curl -s https://codecov.io/bash) diff --git a/README.md b/README.md index 1b4a43e..0dcb2df 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.org/VictoriaMetrics/metrics.svg)](https://travis-ci.org/VictoriaMetrics/metrics) +[![Build Status](https://github.com/VictoriaMetrics/metrics/workflows/main/badge.svg)](https://github.com/VictoriaMetrics/metrics/actions) [![GoDoc](https://godoc.org/github.com/VictoriaMetrics/metrics?status.svg)](http://godoc.org/github.com/VictoriaMetrics/metrics) [![Go Report](https://goreportcard.com/badge/github.com/VictoriaMetrics/metrics)](https://goreportcard.com/report/github.com/VictoriaMetrics/metrics) [![codecov](https://codecov.io/gh/VictoriaMetrics/metrics/branch/master/graph/badge.svg)](https://codecov.io/gh/VictoriaMetrics/metrics)