-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (43 loc) · 1.29 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: "tests"
on:
pull_request:
push:
branches:
- master
- main
jobs:
test:
strategy:
matrix:
go-version: [1.16.x]
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Install libxls
run: |
wget https://github.com/libxls/libxls/releases/download/v1.6.2/libxls-1.6.2.tar.gz \
&& tar -xzvf libxls-1.6.2.tar.gz \
&& cd libxls-1.6.2 \
&& ./configure \
&& sudo make \
&& sudo make install \
&& sudo ldconfig /etc/ld.so.conf.d
shell: bash
- name: Test
run: CGO_LDFLAGS=-lxlsreader go test ./...
- name: Calc coverage
run: |
CGO_LDFLAGS=-lxlsreader go test -coverpkg=./... ./... -count=1 -coverprofile=cover.cov.tmp -v
cat cover.cov.tmp | grep -v "main.go" > profile.cov
- name: Send coverage
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
GO111MODULE=off go get github.com/mattn/goveralls
$(go env GOPATH)/bin/goveralls -coverprofile=profile.cov -service=github