add makefile
This commit is contained in:
parent
2c2a70f7f1
commit
caf8f46e14
32
.github/workflows/ut-check-win.yml
vendored
Normal file
32
.github/workflows/ut-check-win.yml
vendored
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
name: unit test
|
||||||
|
on:
|
||||||
|
# Trigger the workflow on push or pull request,
|
||||||
|
# but only for the master branch
|
||||||
|
push:
|
||||||
|
paths-ignore:
|
||||||
|
- '**.md'
|
||||||
|
- '**.png'
|
||||||
|
pull_request:
|
||||||
|
paths-ignore:
|
||||||
|
- '**.md'
|
||||||
|
- '**.png'
|
||||||
|
jobs:
|
||||||
|
run:
|
||||||
|
name: go test on windows
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
go-version: [1.16.x]
|
||||||
|
runs-on: windows-latest
|
||||||
|
steps:
|
||||||
|
- name: Install Go
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: ${{ matrix.go-version }}
|
||||||
|
# This step checks out a copy of your repository.
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Go test
|
||||||
|
env:
|
||||||
|
GOVERSION: ${{ matrix.go-version }}
|
||||||
|
run: |
|
||||||
|
go test -p 1 .\pkg\...
|
7
.github/workflows/ut-check.yml
vendored
7
.github/workflows/ut-check.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: ut-check
|
name: unit test
|
||||||
on:
|
on:
|
||||||
# Trigger the workflow on push or pull request,
|
# Trigger the workflow on push or pull request,
|
||||||
# but only for the master branch
|
# but only for the master branch
|
||||||
@ -12,7 +12,7 @@ on:
|
|||||||
- '**.png'
|
- '**.png'
|
||||||
jobs:
|
jobs:
|
||||||
run:
|
run:
|
||||||
name: go test
|
name: go test on linux
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version: [1.16.x]
|
go-version: [1.16.x]
|
||||||
@ -29,6 +29,5 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GOVERSION: ${{ matrix.go-version }}
|
GOVERSION: ${{ matrix.go-version }}
|
||||||
run: |
|
run: |
|
||||||
export DEFAULT_EXCEPT_PKGS=e2e
|
make test
|
||||||
go test -p 1 -coverprofile=coverage.txt $(go list ./... | grep -v -E $DEFAULT_EXCEPT_PKGS)
|
|
||||||
bash <(curl -s https://codecov.io/bash) -F unittest-$GOVERSION
|
bash <(curl -s https://codecov.io/bash) -F unittest-$GOVERSION
|
21
Makefile
Normal file
21
Makefile
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
DEFAULT_EXCEPT_PKGS := e2e
|
||||||
|
|
||||||
|
build:
|
||||||
|
go build .
|
||||||
|
|
||||||
|
install:
|
||||||
|
go install ./...
|
||||||
|
|
||||||
|
test:
|
||||||
|
go test -p 1 -coverprofile=coverage.txt ./pkg/...
|
||||||
|
|
||||||
|
fmt:
|
||||||
|
go fmt ./...
|
||||||
|
|
||||||
|
govet-check:
|
||||||
|
go vet ./...
|
||||||
|
|
||||||
|
clean:
|
||||||
|
find ./ -type f -name 'coverage.txt' -delete
|
||||||
|
find ./ -type f -name 'goc' -delete
|
||||||
|
find ./ -type f -name 'gocc' -delete
|
Loading…
Reference in New Issue
Block a user