Skip to content

Commit

Permalink
chore: add workflow for build
Browse files Browse the repository at this point in the history
  • Loading branch information
bayraktugrul committed Oct 9, 2024
1 parent 962c460 commit f3ee74d
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: build
on:
push:
branches:
- main
pull_request:

jobs:
test:
name: Build
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '>=1.22.0'

- name: Run go mod tidy
run: |
set -e
go mod tidy
output=$(git status -s)
if [ -z "${output}" ]; then
exit 0
fi
echo 'We wish to maintain a tidy state for go mod. Please run `go mod tidy` on your branch, commit and push again.'
echo 'Running `go mod tidy` on this CI test yields with the following changes:'
echo "$output"
exit 1
- name: Build
run: go build ./...

0 comments on commit f3ee74d

Please sign in to comment.