Skip to content

Commit 31bc1ac

Browse files
committed
Add github actions
1 parent e7dca22 commit 31bc1ac

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

.github/workflows/tests.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
11+
tests:
12+
name: Test code
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
go:
17+
- ^1.14
18+
- ^1.15
19+
- ^1.16
20+
- ^1
21+
os:
22+
- ubuntu-latest
23+
- macos-latest
24+
steps:
25+
26+
- name: Set up Go
27+
uses: actions/setup-go@v2
28+
with:
29+
go-version: ${{ matrix.go }}
30+
31+
- name: Check out code
32+
uses: actions/checkout@v2
33+
34+
- name: Checkout to the latest tag
35+
run: |
36+
# Fetch all tags
37+
git fetch --depth=1 --tags
38+
# Get the latest tag
39+
VERS=$(git tag -l | sort -Vr | head -n1)
40+
# Fetch everything to the latest tag
41+
git fetch --shallow-since=$(git log $VERS -1 --format=%at)
42+
if: ${{ github.event_name == 'push' }} # only when built from master
43+
44+
- name: Install dependencies
45+
run: |
46+
make install-dependencies
47+
make install-tools
48+
make install
49+
50+
- name: Linting
51+
run: make lint
52+
53+
- name: Testing
54+
run: |
55+
make test-verbose-with-coverage
56+
gover
57+
58+
- name: Coverage
59+
run: goveralls -coverprofile=gover.coverprofile -service=github
60+
env:
61+
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)