Automated change #66
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run CI Tests | |
on: [push] | |
env: | |
GO_VERSION: 1.18.4 | |
jobs: | |
run-tests: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 | |
with: | |
go-version: ${{env.GO_VERSION}} | |
- name: Run golangci-lint | |
uses: golangci/golangci-lint-action@08e2f20817b15149a52b5b3ebe7de50aff2ba8c5 | |
- name: Run Go Vet | |
run: | | |
go vet ./... | |
- name: Run Go Fmt | |
run: | | |
files=$(go fmt ./...) | |
if [ -n "$files" ]; then | |
echo "Please run gofmt on these files ..." | |
echo "$files" | |
exit 1 | |
fi | |
- name: Run Go Test and generate coverage report | |
run: | | |
go test -race -v ./... -coverprofile=coverage.out | |
- name: Upload coverage report | |
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
with: | |
path: coverage.out | |
name: Coverage-report | |
- name: Display coverage report | |
run: go tool cover -func=coverage.out | |
- name: Build Go | |
run: go build ./... |