add GitHub Actions (#293)

This commit is contained in:
daniel 2020-05-22 23:09:56 -07:00 committed by GitHub
parent 4ed75764ce
commit d08a636e7c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 59 additions and 48 deletions

View file

@ -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]+)*(-.*)*/

24
.github/workflows/release.yml vendored Normal file
View file

@ -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 }}

34
.github/workflows/test.yml vendored Normal file
View file

@ -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

View file

@ -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.**