Tests #196 58f9751ec46e87385f1f1cac390fabe276033f80 #30
This file contains 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 Checks | |
on: | |
[push] | |
jobs: | |
gofmt: | |
name: Check Code Formatting | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.20.8 | |
- name: Check formatting | |
run: | | |
FILES=$(gofmt -l .) | |
if [ -n "$FILES" ]; then | |
echo "These files are not formatted correctly:" | |
echo "$FILES" | |
exit 1 | |
fi | |
govet: | |
name: Vet Code | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.20.8 | |
- name: Vet | |
run: go vet ./... | |
gotest: | |
name: Run Tests | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.20.8 | |
- name: Test | |
run: go test ./... | |