Skip to content

Commit

Permalink
github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
khezen committed Dec 19, 2019
1 parent 34be867 commit d19deaf
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 17 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: build
on: [push]
jobs:

test:
name: Test
runs-on: ubuntu-latest
container:
image: golang:buster
steps:

- name: checkout
run: |
git clone https://github.com/$GITHUB_REPOSITORY /go/src/$GITHUB_REPOSITORY
cd /go/src/$GITHUB_REPOSITORY
git checkout $GITHUB_REF
- name: Get dependencies
run: |
cd /go/src/$GITHUB_REPOSITORY
go get -v -t -d ./...
if [ -f Gopkg.toml ]; then
go get github.com/golang/dep/cmd/dep
go build github.com/golang/dep/cmd/dep
dep ensure
fi
- name: unit tests
run: |
cd /go/src/$GITHUB_REPOSITORY
echo "" > coverage.txt
sh test.sh
- name: code coverage
if: github.ref == 'refs/heads/master'
run: |
cd /go/src/$GITHUB_REPOSITORY
curl -s https://codecov.io/bash | bash
13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# rootfinding

[![GoDoc](https://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](https://godoc.org/github.com/khezen/rootfinding)
[![Build Status](http://img.shields.io/travis/khezen/rootfinding.svg?style=flat-square)](https://travis-ci.org/khezen/rootfinding) [![codecov](https://img.shields.io/codecov/c/github/khezen/rootfinding/master.svg?style=flat-square)](https://codecov.io/gh/khezen/rootfinding)
[![Go Report Card](https://goreportcard.com/badge/github.com/khezen/rootfinding?style=flat-square)](https://goreportcard.com/report/github.com/khezen/rootfinding)
[![GoDoc](https://img.shields.io/badge/go-documentation-blue.svg)](https://godoc.org/github.com/khezen/rootfinding)
[![Build Status](https://github.com/khezen/rootfinding/workflows/build/badge.svg?branch=master)](https://github.com/khezen/rootfinding/actions?query=workflow%3Abuild) [![codecov](https://img.shields.io/codecov/c/github/khezen/rootfinding/master.svg)](https://codecov.io/gh/khezen/rootfinding)
[![Go Report Card](https://goreportcard.com/badge/github.com/khezen/rootfinding)](https://goreportcard.com/report/github.com/khezen/rootfinding)

`github.com/khezen/rootfinding`

Expand Down
2 changes: 1 addition & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ unit_tests(){
local ret
ret=0
for d in $(go list ./... | grep -v vendor); do
COV=$(go test -race -coverprofile=profile.out -covermode=atomic $d | sed 's/.*\[no test files\]/0/g' | sed 's/.*coverage//g' | sed 's/[^0-9.]*//g' | sed 's/\.[0-9.]*//g')
COV=$(go test -race -coverprofile=profile.out -covermode=atomic $d | sed 's/.*\[no test files\]/0/g' | sed 's/.*coverage//g' | sed 's/[^0-9.]*//g' | sed 's/\.[0-9.]*//g')
if [ -f profile.out ]; then
cat profile.out >> coverage.txt;
rm profile.out;
Expand Down

0 comments on commit d19deaf

Please sign in to comment.