diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..787fee5 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,31 @@ +name: build + +on: + push: + tags: + - v* + branches: + - master + pull_request: + +jobs: + build: + strategy: + matrix: + os: [ubuntu-latest] + go-version: [1.14.x, 1.15.x] + + name: go-build + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout the code + uses: actions/checkout@v2 + + - name: Setup Go environment + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + + - name: Build the code + run: make build diff --git a/.github/workflows/eris.yml b/.github/workflows/eris.yml deleted file mode 100644 index 4d4f45d..0000000 --- a/.github/workflows/eris.yml +++ /dev/null @@ -1,66 +0,0 @@ -name: eris -on: [push] -jobs: - lint: - name: Lint - runs-on: ubuntu-latest - steps: - - name: Set up Go - uses: actions/setup-go@v1 - with: - go-version: 1.14 - - - name: Check out code - uses: actions/checkout@v1 - - - name: Lint Go code - run: | - export PATH=$PATH:$(go env GOPATH)/bin # temporary fix. See https://github.com/actions/setup-go/issues/14 - go get github.com/golangci/golangci-lint/cmd/golangci-lint - make lint - - build: - name: Build - runs-on: ubuntu-latest - steps: - - - name: Set up Go - uses: actions/setup-go@v1 - with: - go-version: 1.14 - id: go - - - name: Check out code - uses: actions/checkout@v1 - - - name: Get dependencies - run: | - go get -v -t -d ./... - if [ -f Gopkg.toml ]; then - curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh - dep ensure - fi - - - name: Build - run: make build - - test: - name: Test - runs-on: ubuntu-latest - steps: - - name: Set up Go - uses: actions/setup-go@v1 - with: - go-version: 1.14 - - - name: Check out code - uses: actions/checkout@v1 - - - name: Test Go code - run: make test-coverage - - - name: Upload coverage report to CodeCov - uses: codecov/codecov-action@v1.0.0 - with: - token: ${{secrets.CODECOV_TOKEN}} - file: ./cover.out diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..673f4a4 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,28 @@ +name: lint + +on: + push: + tags: + - v* + branches: + - master + pull_request: + +jobs: + golangci: + strategy: + matrix: + os: [ubuntu-latest] + go-version: [1.14.x, 1.15.x] + + name: golangci-lint + runs-on: ${{ matrix.os }} + + steps: + - name: Check out the code + uses: actions/checkout@v2 + + - name: Lint the code + uses: golangci/golangci-lint-action@v2 + with: + version: v1.36 diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml deleted file mode 100644 index ad7aed8..0000000 --- a/.github/workflows/pr.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: pull request -on: [pull_request] -jobs: - lint: - name: Lint - runs-on: ubuntu-latest - steps: - - name: Set up Go - uses: actions/setup-go@v1 - with: - go-version: 1.14 - - - name: Check out code - uses: actions/checkout@v1 - - - name: Lint Go code - run: | - export PATH=$PATH:$(go env GOPATH)/bin # temporary fix. See https://github.com/actions/setup-go/issues/14 - go get github.com/golangci/golangci-lint/cmd/golangci-lint - make lint - - build: - name: Build - runs-on: ubuntu-latest - steps: - - - name: Set up Go - uses: actions/setup-go@v1 - with: - go-version: 1.14 - id: go - - - name: Check out code - uses: actions/checkout@v1 - - - name: Get dependencies - run: | - go get -v -t -d ./... - if [ -f Gopkg.toml ]; then - curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh - dep ensure - fi - - - name: Build - run: make build - - test: - name: Test - runs-on: ubuntu-latest - steps: - - name: Set up Go - uses: actions/setup-go@v1 - with: - go-version: 1.14 - - - name: Check out code - uses: actions/checkout@v1 - - - name: Test Go code - run: make test - - - name: Check test coverage - run: make test-coverage diff --git a/.github/workflows/test-coverage.yml b/.github/workflows/test-coverage.yml new file mode 100644 index 0000000..7c97e64 --- /dev/null +++ b/.github/workflows/test-coverage.yml @@ -0,0 +1,36 @@ +name: test-coverage + +on: + push: + tags: + - v* + branches: + - master + +jobs: + test: + strategy: + matrix: + os: [ubuntu-latest] + go-version: [1.15.x] + + name: go-test-cover + runs-on: ${{ matrix.os }} + + steps: + - name: Check out the code + uses: actions/checkout@v2 + + - name: Setup Go environment + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + + - name: Check test coverage + run: make test-coverage + + - name: Upload coverage report to CodeCov + uses: codecov/codecov-action@v1.0.0 + with: + token: ${{secrets.CODECOV_TOKEN}} + file: ./cover.out diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..5fd7fc8 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,34 @@ +name: test + +on: + push: + tags: + - v* + branches: + - master + pull_request: + +jobs: + test: + strategy: + matrix: + os: [ubuntu-latest] + go-version: [1.14.x, 1.15.x] + + name: go-test + runs-on: ${{ matrix.os }} + + steps: + - name: Check out the code + uses: actions/checkout@v2 + + - name: Setup Go environment + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + + - name: Run the tests + run: make test + + - name: Check test coverage + run: make test-coverage