Skip to content

Commit

Permalink
Merge pull request #102 from jarcoal/github-action
Browse files Browse the repository at this point in the history
ci: new github action
  • Loading branch information
maxatome committed Jan 5, 2021
2 parents 053a927 + a9b59fb commit c34dbbb
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 52 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Build

on:
push:
branches: [ v1 ]
pull_request:
branches: [ v1 ]

jobs:
test:
strategy:
matrix:
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]
full-tests: [false]
include:
- go-version: 1.15.x
full-tests: true

runs-on: ubuntu-latest

steps:
- name: Setup go
run: |
curl -sL https://raw.githubusercontent.com/maxatome/install-go/v2.0/install-go.pl |
perl - ${{ matrix.go-version }} $HOME/go
- name: Checkout code
uses: actions/checkout@v2

- name: Linting
if: matrix.full-tests
run: |
curl -sL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh |
sh -s -- -b $HOME/go/bin v1.33.0
$HOME/go/bin/golangci-lint run --max-issues-per-linter 0 \
--max-same-issues 0 \
-E exportloopref \
-E gocritic \
-E godot \
-E goimports \
-E golint \
-E maligned \
-E misspell \
-E prealloc \
-E unconvert \
-E whitespace \
./...
- name: Testing
continue-on-error: ${{ matrix.go-version == 'tip' }}
run: |
go version
if [ ${{ matrix.full-tests }} = true ]; then
GO_TEST_OPTS="-covermode=atomic -coverprofile=coverage.out"
fi
case ${{ matrix.go-version }} in
1.[789].x | 1.10.x) # Before go 1.11, go modules are not available
mkdir -p ../src/github.com/$GITHUB_REPOSITORY_OWNER
ln -s $(pwd) ../src/github.com/$GITHUB_REPOSITORY
export GOPATH=$(dirname $(pwd))
cd $GOPATH/src/github.com/$GITHUB_REPOSITORY
;;
esac
export GORACE="halt_on_error=1"
go test -race $GO_TEST_OPTS ./...
- name: Reporting
if: matrix.full-tests
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
go get github.com/mattn/goveralls
goveralls -coverprofile=coverage.out -service=github
51 changes: 0 additions & 51 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 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)
# 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)

Easy mocking of http responses from external resources.

Expand Down

0 comments on commit c34dbbb

Please sign in to comment.