Skip to content

Commit

Permalink
Merge pull request #21 from essentialkaos/develop
Browse files Browse the repository at this point in the history
Improve CI workflow
  • Loading branch information
andyone authored Apr 30, 2022
2 parents 27c63ac + c65df88 commit 0327604
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 41 deletions.
53 changes: 17 additions & 36 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:

env:
SRC_DIR: src/github.com/${{ github.repository }}
GO111MODULE: auto

strategy:
matrix:
Expand All @@ -29,13 +28,6 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
id: go

- name: Setup PATH
run: |
echo "GOPATH=${{ github.workspace }}" >> "$GITHUB_ENV"
echo "GOBIN=${{ github.workspace }}/bin" >> "$GITHUB_ENV"
echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH"

- name: Checkout
uses: actions/checkout@v3
Expand All @@ -50,33 +42,29 @@ jobs:
working-directory: ${{env.SRC_DIR}}
run: go test -covermode=count -coverprofile=cover.out

- name: Install goveralls
env:
GO111MODULE: off
run: go get -v github.com/mattn/goveralls

- name: Send coverage to Coveralls
working-directory: ${{env.SRC_DIR}}
- name: Send coverage data
uses: essentialkaos/goveralls-action@v1
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: goveralls -service github -coverprofile cover.out

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '14.x'
path: ${{env.SRC_DIR}}
profile: cover.out
parallel: true
flag-name: linux-${{ matrix.go }}

- name: Install codeclimate-test-reporter
run: npm install -g codeclimate-test-reporter
SendCoverage:
name: Send Coverage
runs-on: ubuntu-latest

- name: Send coverage to Codebeat
working-directory: ${{env.SRC_DIR}}
needs: Go

steps:
- name: Finish parallel tests
uses: essentialkaos/goveralls-action@v1
env:
CODECLIMATE_API_HOST: https://codebeat.co/webhooks/code_coverage
CODECLIMATE_REPO_TOKEN: ${{ secrets.CODECLIMATE_TOKEN }}
run: |
sed -i'.original' 's#/v[0-9]\+/#/#g' cover.out
codeclimate-test-reporter < cover.out
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
parallel-finished: true

Aligo:
name: Aligo
Expand All @@ -86,20 +74,13 @@ jobs:

env:
SRC_DIR: src/github.com/${{ github.repository }}
GO111MODULE: auto

steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.17.x'
id: go

- name: Setup PATH
run: |
echo "GOPATH=${{ github.workspace }}" >> "$GITHUB_ENV"
echo "GOBIN=${{ github.workspace }}/bin" >> "$GITHUB_ENV"
echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH"
- name: Checkout
uses: actions/checkout@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ jobs:
fetch-depth: 2

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: go

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module github.com/essentialkaos/go-zabbix

go 1.17

require github.com/essentialkaos/check v1.2.1
require github.com/essentialkaos/check v1.3.0

require (
github.com/kr/pretty v0.3.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/essentialkaos/check v1.2.1 h1:avvyFy/1acUNwfxwuOLsHeCjfXtMygtbu0lVDr3nxFs=
github.com/essentialkaos/check v1.2.1/go.mod h1:PhxzfJWlf5L/skuyhzBLIvjMB5Xu9TIyDIsqpY5MvB8=
github.com/essentialkaos/check v1.3.0 h1:ria+8o22RCLdt2D/1SHQsEH5Mmy5S+iWHaGHrrbPUc0=
github.com/essentialkaos/check v1.3.0/go.mod h1:PhxzfJWlf5L/skuyhzBLIvjMB5Xu9TIyDIsqpY5MvB8=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
Expand Down

0 comments on commit 0327604

Please sign in to comment.