Merge pull request #363 from mum4k/github_actions

Defining Github action to execute Termdash CI.
This commit is contained in:
Jakub Sobon 2024-01-29 14:43:47 -05:00 committed by GitHub
commit 821b47af21
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 51 additions and 21 deletions

51
.github/go.yml vendored Normal file
View File

@ -0,0 +1,51 @@
# This workflow will builds and tests Termdash.
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Go
on:
push:
branches: [ "master", "devel" ]
pull_request:
branches: [ "master", "devel" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ '1.20', 'stable' ]
steps:
- uses: actions/checkout@v3
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Install dependencies
run: |
go install golang.org/x/tools/cmd/cover@latest
go install github.com/mattn/goveralls@latest
go install golang.org/x/lint/golint@latest
go get -t ./...
- name: Test
run: go test -v -covermode=count -coverprofile=coverage.out ./...
- name: Test Race
run: CGO_ENABLED=1 go test -race ./...
- name: Format
run: diff -u <(echo -n) <(gofmt -d -s .)
- name: Licences
run: diff -u <(echo -n) <(./private/scripts/autogen_licences.sh .)
- name: Lint
run: diff -u <(echo -n) <(golint ./...)
- name: Coverage
run: $GOPATH/bin/goveralls -coverprofile=coverage.out -service=travis-ci -repotoken $COVERALLS_TOKEN

View File

@ -1,21 +0,0 @@
language: go
go:
- 1.20.x
- stable
before_install:
- go install golang.org/x/tools/cmd/cover@latest
- go install github.com/mattn/goveralls@latest
- go install golang.org/x/lint/golint@latest
script:
- go get -t ./...
- go test -v -covermode=count -coverprofile=coverage.out ./...
- CGO_ENABLED=1 go test -race ./...
- go vet ./...
- diff -u <(echo -n) <(gofmt -d -s .)
- diff -u <(echo -n) <(./private/scripts/autogen_licences.sh .)
- diff -u <(echo -n) <(golint ./...)
- $GOPATH/bin/goveralls -coverprofile=coverage.out -service=travis-ci -repotoken $COVERALLS_TOKEN
env:
global:
- CGO_ENABLED=0
- secure: FEFt9o7MvSvK2lnXJTydml/DCmNqPKIc+YJjPlKhfeGGJyruFvP55qkB0rHN7wb2r4L44qMqtM12c41YzA0sFhXXNowhCB0wd7mfyEt3cCLr4akqRedxOpz+qFBGv2oCBObP6e6irtsN0071KtDz9wsITchme3gf0A8l9PhjPeEu9UVbmN8lipouvQFqmdxqLNyxJ+ykbACkSTwIx2rkvU79aOPDoSnDO56Wqaq7V75CmZ13EtHupgmJIz2GECyIL6Ll6824AQiK1O5XXpnc8973Vw1s6kZB5Tyzvb2KaW5U9KhovgX1mTvnj1XJ//SQvh9yMjC5L51DLNbLSshVo7L4CiJZkq8QQLFILPOMaC1emrmhXxwizjbTmNOo96t2MYk2WASq636Uoez0ZkkZPjuwuKoexFi7r04vHEOjnF2N9liN+M8gwvJ5N/MakbS3ZPbZ+57w4xgwuxJRSUYQoT1VSU8E2rc+DQYa4HzY4wrcrJQG7HBjd4KBHnmHjEDAmawBb6iEI9d5d40j0LThxAOweh05YoWVmnTzMScuO27V5embStXab31jUrD4Qnj5/lliklGdYD5aWLKRZhSeg5mLikUITbhriABuUxMaR1FuQW4r1nSg3n8XA6MbwdvngO2DJyzp5iUQX3yfnUgrGzfp9okrA4CdxUHrY/jj8cw=