From 5e7d773e1bd2a3e0e2c2b8eb3ac03f0a2f6851c1 Mon Sep 17 00:00:00 2001 From: sunboyy Date: Tue, 19 Jan 2021 19:11:25 +0700 Subject: [PATCH] Add CodeCov to GitHub Actions --- .github/workflows/build.yml | 15 +++------------ .github/workflows/lint.yml | 31 +++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dfdcff4..44ae7f3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,21 +17,12 @@ jobs: with: go-version: 1.15 - - name: Install dependencies - run: go get -u golang.org/x/lint/golint - - name: Build run: go build -v ./... - name: Test - run: go test -v ./... + run: go test -v ./... -covermode=count -coverprofile=cover.out - - name: Vet & Lint - run: | - go vet ./... - golint ./... - - - name: golangci-lint - uses: golangci/golangci-lint-action@v2 + - uses: codecov/codecov-action@v1 with: - version: v1.35.2 + flags: unittests diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..cde7250 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,31 @@ +name: lint + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.15 + + - name: Install dependencies + run: go get -u golang.org/x/lint/golint + + - name: Vet & Lint + run: | + go vet ./... + golint ./... + + - name: golangci-lint + uses: golangci/golangci-lint-action@v2 + with: + version: v1.35.2