Add frontend workflow for testing (#103) #43
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: Go Format | |
on: | |
push: | |
branches: | |
- "main" | |
pull_request: | |
branches: | |
- "*" | |
jobs: | |
gofmt: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: "1.21" | |
- name: Check Go formatting | |
run: | | |
files=$(gofmt -l ./backend) | |
if [[ -n "$files" ]]; then | |
echo "The following files are not formatted correctly:" | |
echo "$files" | |
echo "Please run 'gofmt -w .' inside the backend directory before committing." | |
exit 1 | |
else | |
echo "All Go files are properly formatted." | |
fi |