Skip to content

set on push tag only #17

set on push tag only

set on push tag only #17

Workflow file for this run

name: Go Test
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.21
- name: Run Tests
run: |
go test -v -coverprofile=coverage.txt -covermode=atomic ./...
- name: Lint Code
run: go vet ./...
- name: Install Dependencies
run: go mod download
- name: Build
run: go build ./...
- name: Check for Code Formatting
run: |
fmtcount=$(gofmt -l . | wc -l)
if [ $fmtcount -gt 0 ]; then
echo "Code is not formatted. Run 'gofmt' and commit the changes."
exit 1
fi