Skip to content

Commit

Permalink
Merge pull request #2 from include-x/feature/add-github-actions
Browse files Browse the repository at this point in the history
Add Github actions
  • Loading branch information
include-x committed Mar 9, 2021
2 parents 9701167 + cf97d44 commit d614971
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 31 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Static analysis
on: [push, pull_request]
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
# The version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.36
31 changes: 31 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Tests
on: [ push, pull_request ]
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.15.x
- name: Format
run: if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi
build:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.15.x
- uses: actions/checkout@v2
- name: Run Build
run: go build
- name: Run Tests
run: go test -v -coverprofile=profile.cov -json ./... > tests_report.json
- name: Annotate GH commit or PR
uses: guyarb/golang-test-annoations@v0.3.0
with:
test-results: tests_report.json
- name: Tests Coverage
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: profile.cov
29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
[![Build Status](https://travis-ci.org/AidosKuneen/numcpu.svg?branch=master)](https://travis-ci.org/AidosKuneen/numcpu)
![Golangci lint](https://github.com/AidosKuneen/numcpu/actions/workflows/golangci-lint.yml/badge.svg)
![Tests](https://github.com/AidosKuneen/numcpu/actions/workflows/tests.yml/badge.svg)
[![Coverage Status](https://coveralls.io/repos/github/AidosKuneen/numcpu/badge.svg?branch=master)](https://coveralls.io/github/AidosKuneen/numcpu?branch=master)
[![GoDoc](https://godoc.org/github.com/AidosKuneen/numcpu?status.svg)](https://godoc.org/github.com/AidosKuneen/numcpu)
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/AidosKuneen/numcpu/master/LICENSE)

Expand Down Expand Up @@ -38,4 +40,4 @@ are required to compile.

```
Golang Standard Library BSD 3-clause License
```
```

0 comments on commit d614971

Please sign in to comment.