Skip to content

Commit 8092238

Browse files
authored
fix inttest run in ci (#11)
do not run on push and pull request don't run build before inttest
1 parent b83752c commit 8092238

File tree

2 files changed

+23
-14
lines changed

2 files changed

+23
-14
lines changed

.github/workflows/test_and_build.yml

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
on: [push, pull_request]
1+
on:
2+
push:
3+
branches:
4+
- master
5+
pull_request:
6+
branches:
7+
- master
8+
29
name: test and build
310
jobs:
411
lint:
@@ -7,12 +14,13 @@ jobs:
714
- name: Install Go
815
uses: actions/setup-go@v1
916
with:
10-
go-version: 1.13.x
17+
go-version: 1.16.x
1118
- name: Checkout code
12-
uses: actions/checkout@v1
13-
- name: Install golangci-lint
14-
run: |
15-
go get github.com/golangci/golangci-lint/cmd/golangci-lint
19+
uses: actions/checkout@v2
20+
- name: golangci-lint
21+
uses: golangci/golangci-lint-action@v2
22+
with:
23+
version: v1.39.0
1624
- name: Run linters
1725
run: |
1826
export PATH=$PATH:$(go env GOPATH)/bin
@@ -25,9 +33,9 @@ jobs:
2533
if: success()
2634
uses: actions/setup-go@v1
2735
with:
28-
go-version: 1.15.x
36+
go-version: 1.16.x
2937
- name: Checkout code
30-
uses: actions/checkout@v1
38+
uses: actions/checkout@v2
3139
- name: Run tests
3240
run: make test
3341
- name: Convert coverage to lcov
@@ -48,9 +56,9 @@ jobs:
4856
- name: Install Go
4957
uses: actions/setup-go@v1
5058
with:
51-
go-version: 1.15.x
59+
go-version: 1.16.x
5260
- name: Checkout code
53-
uses: actions/checkout@v1
61+
uses: actions/checkout@v2
5462
- name: build
5563
run: |
5664
export GO111MODULE=on
@@ -67,11 +75,12 @@ jobs:
6775
runs-on: ubuntu-latest
6876
steps:
6977
- name: Checkout code
70-
uses: actions/checkout@v1
71-
- name: Download binary from build stage
78+
uses: actions/checkout@v2
79+
- name: Download binaries from build stage
7280
uses: actions/download-artifact@v1
7381
with:
7482
name: bin
7583
- name: Run test
7684
run: |
85+
chmod 755 bin/*
7786
make inttest

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# makefile for gcov2lcov
2-
.PHONY: build test inttest
2+
.PHONY: build test inttest clean
33

44
build:
55
GOOS=linux GOARCH=amd64 go build -o bin/gcov2lcov-linux-amd64 .
@@ -10,7 +10,7 @@ test:
1010
go test ./... -coverprofile coverage.out
1111
go tool cover -func coverage.out
1212

13-
inttest: build
13+
inttest:
1414
./bin/gcov2lcov-linux-amd64 -infile testdata/coverage.out -outfile coverage.lcov
1515
diff -y testdata/coverage_expected.lcov coverage.lcov
1616

0 commit comments

Comments
 (0)