Skip to content

Commit c34dbbb

Browse files
authored
Merge pull request #102 from jarcoal/github-action
ci: new github action
2 parents 053a927 + a9b59fb commit c34dbbb

File tree

3 files changed

+74
-52
lines changed

3 files changed

+74
-52
lines changed

.github/workflows/ci.yml

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [ v1 ]
6+
pull_request:
7+
branches: [ v1 ]
8+
9+
jobs:
10+
test:
11+
strategy:
12+
matrix:
13+
go-version: [1.7.x, 1.8.x, 1.9.x, 1.10.x, 1.11.x, 1.12.x, 1.13.x, 1.14.x, tip]
14+
full-tests: [false]
15+
include:
16+
- go-version: 1.15.x
17+
full-tests: true
18+
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Setup go
23+
run: |
24+
curl -sL https://raw.githubusercontent.com/maxatome/install-go/v2.0/install-go.pl |
25+
perl - ${{ matrix.go-version }} $HOME/go
26+
27+
- name: Checkout code
28+
uses: actions/checkout@v2
29+
30+
- name: Linting
31+
if: matrix.full-tests
32+
run: |
33+
curl -sL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh |
34+
sh -s -- -b $HOME/go/bin v1.33.0
35+
$HOME/go/bin/golangci-lint run --max-issues-per-linter 0 \
36+
--max-same-issues 0 \
37+
-E exportloopref \
38+
-E gocritic \
39+
-E godot \
40+
-E goimports \
41+
-E golint \
42+
-E maligned \
43+
-E misspell \
44+
-E prealloc \
45+
-E unconvert \
46+
-E whitespace \
47+
./...
48+
49+
- name: Testing
50+
continue-on-error: ${{ matrix.go-version == 'tip' }}
51+
run: |
52+
go version
53+
if [ ${{ matrix.full-tests }} = true ]; then
54+
GO_TEST_OPTS="-covermode=atomic -coverprofile=coverage.out"
55+
fi
56+
case ${{ matrix.go-version }} in
57+
1.[789].x | 1.10.x) # Before go 1.11, go modules are not available
58+
mkdir -p ../src/github.com/$GITHUB_REPOSITORY_OWNER
59+
ln -s $(pwd) ../src/github.com/$GITHUB_REPOSITORY
60+
export GOPATH=$(dirname $(pwd))
61+
cd $GOPATH/src/github.com/$GITHUB_REPOSITORY
62+
;;
63+
esac
64+
export GORACE="halt_on_error=1"
65+
go test -race $GO_TEST_OPTS ./...
66+
67+
- name: Reporting
68+
if: matrix.full-tests
69+
env:
70+
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71+
run: |
72+
go get github.com/mattn/goveralls
73+
goveralls -coverprofile=coverage.out -service=github

.travis.yml

-51
This file was deleted.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# httpmock [![Build Status](https://travis-ci.org/jarcoal/httpmock.png?branch=v1)](https://travis-ci.org/jarcoal/httpmock) [![Coverage Status](https://coveralls.io/repos/github/jarcoal/httpmock/badge.svg?branch=v1)](https://coveralls.io/github/jarcoal/httpmock?branch=v1) [![GoDoc](https://godoc.org/github.com/jarcoal/httpmock?status.svg)](https://godoc.org/github.com/jarcoal/httpmock) [![Version](https://img.shields.io/github/tag/jarcoal/httpmock.svg)](https://github.com/jarcoal/httpmock/releases) [![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go/#testing)
1+
# httpmock [![Build Status](https://github.com/jarcoal/httpmock/workflows/Build/badge.svg?branch=v1)](https://github.com/jarcoal/httpmock/actions?query=workflow%3ABuild) [![Coverage Status](https://coveralls.io/repos/github/jarcoal/httpmock/badge.svg?branch=v1)](https://coveralls.io/github/jarcoal/httpmock?branch=v1) [![GoDoc](https://godoc.org/github.com/jarcoal/httpmock?status.svg)](https://godoc.org/github.com/jarcoal/httpmock) [![Version](https://img.shields.io/github/tag/jarcoal/httpmock.svg)](https://github.com/jarcoal/httpmock/releases) [![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go/#testing)
22

33
Easy mocking of http responses from external resources.
44

0 commit comments

Comments
 (0)