Skip to content

Commit 4e359d1

Browse files
authored
build on github actions (#36)
1 parent 27780fa commit 4e359d1

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

.github/workflows/ci.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: CI
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
10+
strategy:
11+
matrix:
12+
go: [1.8, 1.9, '1.10', 1.11, 1.12, 1.13, 1.14, 1.15, 1.16]
13+
14+
steps:
15+
16+
- name: Checkout to GOPATH
17+
if: ${{ matrix.go == '1.8' || matrix.go == '1.9' || matrix.go == '1.10' }}
18+
uses: actions/checkout@v2
19+
with:
20+
path: go/src/github.com/${{ github.repository }}
21+
22+
- name: Checkout with no GOPATH
23+
if: ${{ matrix.go != '1.8' && matrix.go != '1.9' && matrix.go != '1.10' }}
24+
uses: actions/checkout@v2
25+
26+
- name: Set up Go ${{ matrix.go }}
27+
uses: actions/setup-go@v1
28+
with:
29+
go-version: ${{ matrix.go }}
30+
31+
- name: "Setup dependencies"
32+
if: ${{ matrix.go == '1.8' || matrix.go == '1.9' || matrix.go == '1.10' }}
33+
run: go get -t ./... && cd $GOPATH/src/github.com/stretchr/testify/ && git checkout v1.2.2 && cd - && pwd
34+
env:
35+
GOPATH: /home/runner/work/errorx/errorx/go
36+
37+
- name: Build no modules
38+
if: ${{ matrix.go == '1.8' || matrix.go == '1.9' || matrix.go == '1.10' }}
39+
run: cd go/src/github.com/${{ github.repository }} && go test -v ./...
40+
env:
41+
GOPATH: /home/runner/work/errorx/errorx/go
42+
43+
- name: Build with modules
44+
if: ${{ matrix.go != '1.8' && matrix.go != '1.9' && matrix.go != '1.10' }}
45+
run: go test -v ./...
46+

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
[![Build Status](https://travis-ci.com/joomcode/errorx.svg?branch=master)](https://travis-ci.com/joomcode/errorx)
1+
[![Github Actions Build Status](https://github.com/joomcode/errorx/workflows/CI/badge.svg)](https://github.com/joomcode/errorx/actions)
2+
[![Travis Build Status](https://travis-ci.com/joomcode/errorx.svg?branch=master)](https://travis-ci.com/joomcode/errorx)
23
[![GoDoc](https://img.shields.io/static/v1?label=godev&message=reference&color=00add8)](https://pkg.go.dev/github.com/joomcode/errorx?tab=doc)
34
[![Report Card](https://goreportcard.com/badge/github.com/joomcode/errorx)](https://goreportcard.com/report/github.com/joomcode/errorx)
45
[![gocover.io](https://gocover.io/_badge/github.com/joomcode/errorx)](https://gocover.io/github.com/joomcode/errorx)

0 commit comments

Comments
 (0)