diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index eea4d047..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,103 +0,0 @@ -# Copyright 2020 Coinbase, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -version: 2.1 -executors: - default: - docker: - - image: circleci/golang:1.15 - user: root # go directory is owned by root - working_directory: /go/src/github.com/coinbase/rosetta-bitcoin - environment: - - GO111MODULE: "on" - -fast-checkout: &fast-checkout - attach_workspace: - at: /go - -jobs: - setup: - executor: - name: default - steps: - - checkout - - run: make deps - - persist_to_workspace: - root: /go - paths: - - src - - bin - - pkg/mod/cache - test: - executor: - name: default - steps: - - *fast-checkout - - run: make test - lint: - executor: - name: default - steps: - - *fast-checkout - - run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.32.2 - - run: make lint - check-license: - executor: - name: default - steps: - - *fast-checkout - - run: make check-license - check-format: - executor: - name: default - steps: - - *fast-checkout - - run: make check-format - coverage: - executor: - name: default - steps: - - *fast-checkout - - run: make coverage - salus: - machine: true - steps: - - checkout - - run: make salus - -workflows: - version: 2 - build: - jobs: - - setup - - test: - requires: - - setup - - lint: - requires: - - setup - - check-license: - requires: - - setup - - check-format: - requires: - - setup - - coverage: - requires: - - setup - - salus - -notify: - webhooks: - - url: https://coveralls.io/webhook?repo_token=$COVERALLS_TOKEN diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..c4fd8bd9 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,51 @@ +name: CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + test: + name: Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: 1.15 + - run: make build + + - run: make coverage + - uses: codecov/codecov-action@v1 + + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: 1.15 + + - run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.32.2 + - run: make lint + + format: + name: Format + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: 1.15 + + - run: make check-format + + salus: + name: Salus + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: make salus diff --git a/Makefile b/Makefile index 0737d29d..c0c74dfa 100644 --- a/Makefile +++ b/Makefile @@ -71,8 +71,8 @@ check-format: test: ${TEST_SCRIPT} -coverage: - if [ "${COVERALLS_TOKEN}" ]; then ${TEST_SCRIPT} -coverprofile=c.out -covermode=count; ${GOVERALLS_CMD} -coverprofile=c.out -repotoken ${COVERALLS_TOKEN}; fi +coverage: + ${TEST_SCRIPT} -coverprofile=c.out -covermode=count coverage-local: ${TEST_SCRIPT} -cover