Commit d73da60 1 parent 2b2e892 commit d73da60 Copy full SHA for d73da60
File tree 4 files changed +40
-129
lines changed
4 files changed +40
-129
lines changed Original file line number Diff line number Diff line change
1
+ on : [push, pull_request]
2
+ name : Linting and Unit tests
3
+ jobs :
4
+ linting_unit_tests :
5
+ strategy :
6
+ matrix :
7
+ go-version : [1.15.x]
8
+ os : [ubuntu-latest]
9
+ runs-on : ${{ matrix.os }}
10
+ defaults :
11
+ run :
12
+ working-directory : ${{ env.HOME }}/go/src/github.com/${{ github.repository }}
13
+ steps :
14
+ - name : Set up Go
15
+ uses : actions/setup-go@v2
16
+ with :
17
+ go-version : ${{ matrix.go-version }}
18
+ - name : Setup env
19
+ run : |
20
+ echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
21
+ - name : Check out code
22
+ uses : actions/checkout@v2
23
+ with :
24
+ path : ${{ env.GOPATH }}/src/github.com/${{ github.repository }}
25
+ - name : Install dependencies
26
+ run : |
27
+ make install-deps
28
+ - name : Lint check
29
+ run : |
30
+ make lint-check gen-swagger
31
+ echo "Checking that swagger gen didn't result in a modified git tree" && git diff --exit-code ./http
32
+ - name : Unit tests
33
+ run : |
34
+ go test -race -coverprofile=coverage.txt -covermode=atomic --tags=unit ./...
35
+ - name : Upload coverage
36
+ run : bash <(curl -s https://codecov.io/bash)
Original file line number Diff line number Diff line change @@ -42,14 +42,9 @@ install:
42
42
jobs :
43
43
include :
44
44
- stage : " Tests"
45
- name : " Linting "
45
+ name : " CMD tests "
46
46
script :
47
- - make lint-check gen-swagger generate format-go
48
- - echo "Checking that swagger gen didn't result in a modified git tree" && git diff --exit-code ./http
49
- - stage : " Tests"
50
- name : " Unit and CMD tests"
51
- script :
52
- - ./build/scripts/test_wrapper.sh unit cmd
47
+ - ./build/scripts/test_wrapper.sh cmd
53
48
after_success :
54
49
- bash <(curl -s https://codecov.io/bash)
55
50
- stage : " Tests"
Original file line number Diff line number Diff line change @@ -41,11 +41,12 @@ install-deps: ## Install Dependencies
41
41
@go install github.com/ethereum/go-ethereum/cmd/abigen
42
42
@go install github.com/karalabe/xgo
43
43
@git submodule update --init --recursive
44
+ @env
44
45
@command -v golangci-lint > /dev/null 2>&1 || (curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ${GOPATH} /bin v1.36.0)
45
46
46
47
lint-check : # # runs linters on go code
47
48
@golangci-lint run --skip-dirs=build/* --disable-all --enable=golint --enable=goimports --enable=vet --enable=nakedret \
48
- --enable=unused --skip-dirs=resources --skip-dirs=testingutils ./...;
49
+ --enable=unused --skip-dirs=resources --skip-dirs=testingutils --timeout=2m ./...;
49
50
50
51
format-go : # # formats go code
51
52
@golangci-lint run --disable-all --enable=goimports --fix ./...
You can’t perform that action at this time.
0 commit comments