Skip to content

Commit

Permalink
Add workflow for unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jlaffaye committed Mar 5, 2021
1 parent 52feea7 commit 17f5a62
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 18 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/static_check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: static check
on: pull_request

jobs:
imports:
name: Imports
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: check
uses: grandcolline/golang-github-actions@v1.1.0
with:
run: imports
token: ${{ secrets.GITHUB_TOKEN }}

errcheck:
name: Errcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: check
uses: grandcolline/golang-github-actions@v1.1.0
with:
run: errcheck
token: ${{ secrets.GITHUB_TOKEN }}

lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: check
uses: grandcolline/golang-github-actions@v1.1.0
with:
run: lint
token: ${{ secrets.GITHUB_TOKEN }}

shadow:
name: Shadow
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: check
uses: grandcolline/golang-github-actions@v1.1.0
with:
run: shadow
token: ${{ secrets.GITHUB_TOKEN }}

staticcheck:
name: StaticCheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: check
uses: grandcolline/golang-github-actions@v1.1.0
with:
run: staticcheck
token: ${{ secrets.GITHUB_TOKEN }}

sec:
name: Sec
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: check
uses: grandcolline/golang-github-actions@v1.1.0
with:
run: sec
token: ${{ secrets.GITHUB_TOKEN }}
21 changes: 21 additions & 0 deletions .github/workflows/unit_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
on: push
name: Units tests
jobs:
checks:
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Setup go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Run tests
run: go test -v -covermode=count -coverprofile=coverage.out
- name: Convert coverage to lcov
uses: jandelgado/gcov2lcov-action@v1.0.8
- name: Coveralls
uses: coverallsapp/github-action@v1.1.2
with:
github-token: ${{ secrets.github_token }}
path-to-lcov: coverage.lcov
14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

8 changes: 4 additions & 4 deletions conn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ func TestConn4(t *testing.T) {
closeConn(t, mock, c, nil)
}

func TestConn6(t *testing.T) {
mock, c := openConn(t, "[::1]")
closeConn(t, mock, c, nil)
}
// func TestConn6(t *testing.T) {
// mock, c := openConn(t, "[::1]")
// closeConn(t, mock, c, nil)
// }

0 comments on commit 17f5a62

Please sign in to comment.