Skip to content

Commit dbe8db4

Browse files
committed
[run-build-tests.yml] edited test environment
Edited yml file for Github Actions and service Coveralls
1 parent 31234a3 commit dbe8db4

File tree

2 files changed

+115
-60
lines changed

2 files changed

+115
-60
lines changed
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
name: run-build
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- dev
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
linters:
13+
# go vet and go fmt are mandatory.
14+
# Other linters are optional but should dispay issues.
15+
name: Linters
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Setup go 1.16
20+
uses: actions/setup-go@v2
21+
with:
22+
go-version: '1.16'
23+
- name: Run go vet
24+
run: |
25+
go mod download github.com/mattn/go-isatty
26+
go vet ./...
27+
- name: Run gofmt
28+
run: |
29+
gofmt -s -l .
30+
if [ "$(gofmt -l . | wc -l)" -gt 0 ]; then exit 1; fi
31+
- name: Run golint
32+
run: |
33+
go get golang.org/x/lint/golint
34+
golint ./...
35+
continue-on-error: true
36+
- name: Run staticcheck
37+
run: |
38+
go get honnef.co/go/tools/cmd/staticcheck
39+
staticcheck ./...
40+
continue-on-error: true
41+
- name: Run errcheck
42+
run: |
43+
go get github.com/kisielk/errcheck
44+
errcheck ./...
45+
continue-on-error: true
46+
47+
build:
48+
name: build
49+
strategy:
50+
matrix:
51+
go-version: [1.14.x, 1.15.x, 1.16.x]
52+
platform: [ubuntu-latest]
53+
runs-on: ${{ matrix.platform }}
54+
steps:
55+
- name: Install Go
56+
uses: actions/setup-go@v1
57+
with:
58+
go-version: ${{ matrix.go-version }}
59+
- name: Checkout code
60+
uses: actions/checkout@v2
61+
- name: Run unit tests
62+
run: |
63+
go mod download github.com/mattn/go-isatty
64+
go build ./cmd/ginvalid
65+
tests:
66+
runs-on: [ubuntu-latest]
67+
steps:
68+
- uses: actions/checkout@v2
69+
- name: Setup Go 1.16
70+
uses: actions/setup-go@v2
71+
with:
72+
go-version: '1.16'
73+
- name: Install git annex dependency
74+
run: |
75+
bash <(wget -q -O- http://neuro.debian.net/_files/neurodebian-travis.sh)
76+
sudo apt-get update -qq
77+
sudo apt-get install git-annex-standalone
78+
git version
79+
git annex version
80+
- name: Show Go version
81+
run: go version
82+
- name: Fetch dependencies
83+
run: go get -d ./...
84+
- name: Run build
85+
run: go build ./cmd/ginvalid
86+
- name: Run tests
87+
run: go test ./...
88+
run-coverall:
89+
runs-on: [ubuntu-latest]
90+
steps:
91+
- uses: actions/checkout@v2
92+
- name: Use golang version 1.16
93+
uses: actions/setup-go@v2
94+
with:
95+
go-version: '1.16'
96+
- name: Install git annex dependency
97+
run: |
98+
bash <(wget -q -O- http://neuro.debian.net/_files/neurodebian-travis.sh)
99+
sudo apt-get update -qq
100+
sudo apt-get install git-annex-standalone
101+
git version
102+
git annex version
103+
- name: Fetch dependencies
104+
run: |
105+
go get -d ./...
106+
go get github.com/mattn/[email protected]
107+
go get github.com/spf13/[email protected]
108+
go get github.com/spf13/[email protected]
109+
go get github.com/mattn/goveralls
110+
- name: Create test coverage
111+
run: go test -covermode atomic -coverprofile=covprofile ./...
112+
- name: Send coverage
113+
env:
114+
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
115+
run: goveralls -coverprofile=covprofile -service=github

.github/workflows/run-build.yml

Lines changed: 0 additions & 60 deletions
This file was deleted.

0 commit comments

Comments
 (0)