diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index d5cb5d0..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,97 +0,0 @@ -version: 2 # use CircleCI 2.0 - -jobs: - - build: - - docker: - # CircleCI Go images available at: https://hub.docker.com/r/circleci/golang/ - - image: circleci/golang:1.14 - - environment: # environment variables for the build itself - TEST_RESULTS: /tmp/test-results # path to where test results will be saved - - steps: # steps that comprise the `build` job - - checkout # check out source code to working directory - - run: mkdir -p ${TEST_RESULTS} # create the test results directory - - restore_cache: # restores saved cache if no changes are detected since last run - keys: - - go-mod-v4-{{ checksum "go.sum" }} - - - run: - name: Run unit tests - command: go test -coverprofile=coverage.txt ./...; cp coverage.txt ${TEST_RESULTS} - - - run: - name: Upload codecov - command: bash <(curl -s https://codecov.io/bash) - - - save_cache: - key: go-mod-v4-{{ checksum "go.sum" }} - paths: - - "/go/pkg/mod" - - - store_artifacts: # upload test summary for display in Artifacts - path: /tmp/test-results - destination: raw-test-output - - - store_test_results: # upload test results for display in Test Summary - path: /tmp/test-results - - release: - - docker: - - image: circleci/golang:1.14 - - steps: - - checkout - - restore_cache: # restores saved cache if no changes are detected since last run - keys: - - go-mod-v4-{{ checksum "go.sum" }} - - - run: - name: Set GoReleaser Version - command: | - echo "export VERSION=v0.128.0" >> $BASH_ENV - - - run: - name: "Run GoReleaser" - command: curl -sL https://git.io/goreleaser | bash - - build-dist: - - docker: - - image: circleci/golang:1.14 - - steps: - - checkout - - restore_cache: # restores saved cache if no changes are detected since last run - keys: - - go-mod-v4-{{ checksum "go.sum" }} - - - run: - name: Set GoReleaser Version - command: | - echo "export VERSION=v0.128.0" >> $BASH_ENV - - - run: - name: "Run GoReleaser" - command: curl -sL https://git.io/goreleaser | bash -s -- --snapshot --skip-publish --rm-dist - -workflows: - version: 2 - build-and-release: - jobs: - - build: - filters: # required since `release` has tag filters AND requires `build` - tags: - only: /.*/ - - release: - context: apigee-remote-service - requires: - - build - filters: # Only run on git tag pushes - branches: - ignore: /.*/ - tags: - only: /v[0-9]+(\.[0-9]+)*(-.*)*/ diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..4959d7b --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,35 @@ +name: Build + +on: + push: + pull_request: + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - + name: Check out code + uses: actions/checkout@v1 + - + name: Reviewdog Lint + uses: reviewdog/action-golangci-lint@v1 + with: + reporter: github-check + + test: + name: Test and Cover + runs-on: ubuntu-latest + steps: + - + name: Check out code + uses: actions/checkout@v1 + - + name: Run Unit tests + run: go test -coverprofile=coverage.txt ./... + - + name: Upload Coverage report to CodeCov + uses: codecov/codecov-action@v1 + with: + file: ./coverage.txt diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..ab7fa25 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,29 @@ +name: Release + +on: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+*' # semver v1.0.0-beta.2 + +jobs: + release: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - + name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.14 + - + name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index 2217f8e..e3f9356 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![](https://circleci.com/gh/apigee/apigee-remote-service-cli.svg?style=svg)](https://circleci.com/gh/apigee/apigee-remote-service-cli) +[![Build](https://github.com/apigee/apigee-remote-service-cli/workflows/Build/badge.svg)](https://github.com/apigee/apigee-remote-service-cli/workflows/Build/badge.svg) [![Go Report Card](https://goreportcard.com/badge/github.com/apigee/apigee-remote-service-cli)](https://goreportcard.com/report/github.com/apigee/apigee-remote-service-cli) [![codecov.io](https://codecov.io/github/apigee/apigee-remote-service-cli/coverage.svg?branch=master)](https://codecov.io/github/apigee/apigee-remote-service-cli?branch=master)