diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 8c8171f..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,47 +0,0 @@ -version: 2 -jobs: - release: - docker: - - image: circleci/golang:1.13 - working_directory: /go/src/github.com/d5/tegno - steps: - - checkout - - restore_cache: - keys: - - go-mod-v1-{{ checksum "go.sum" }} - - run: curl -sL https://git.io/goreleaser | bash - - save_cache: - key: go-mod-v1-{{ checksum "go.sum" }} - paths: - - "/go/pkg/mod" - test: - docker: - - image: circleci/golang:1.13 - working_directory: /go/src/github.com/d5/tegno - steps: - - checkout - - restore_cache: - keys: - - go-mod-v1-{{ checksum "go.sum" }} - - run: go get -u golang.org/x/lint/golint - - run: make test - - save_cache: - key: go-mod-v1-{{ checksum "go.sum" }} - paths: - - "/go/pkg/mod" -workflows: - version: 2 - test: - jobs: - - test: - filters: - tags: - ignore: /.*/ - release: - jobs: - - release: - filters: - branches: - ignore: /.*/ - tags: - only: /v[0-9]+(\.[0-9]+)*(-.*)*/ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f760294 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,24 @@ +name: release +on: + push: + tags: + - '*' +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - name: check out + uses: actions/checkout@v2 + - name: Unshallow + run: git fetch --prune --unshallow + - 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 }} \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..555f918 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,34 @@ +name: test +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] +jobs: + 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: set up Go module cache + uses: actions/cache@v1 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + - name: setup env + run: | + echo "::set-env name=GOPATH::$(go env GOPATH)" + echo "::add-path::$(go env GOPATH)/bin" + shell: bash + - name: check out code + uses: actions/checkout@v2 + - name: install golint + run: go get -u golang.org/x/lint/golint + - name: run tests + run: make test diff --git a/README.md b/README.md index 47eec3c..bee1959 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,8 @@ # The Tengo Language [![GoDoc](https://godoc.org/github.com/d5/tengo?status.svg)](https://godoc.org/github.com/d5/tengo) +![test](https://github.com/d5/tengo/workflows/test/badge.svg) [![Go Report Card](https://goreportcard.com/badge/github.com/d5/tengo)](https://goreportcard.com/report/github.com/d5/tengo) -[![CircleCI](https://circleci.com/gh/d5/tengo.svg?style=svg)](https://circleci.com/gh/d5/tengo) **Tengo is a small, dynamic, fast, secure script language for Go.**