Tests #201 ee12a6cf60466214c1104862de58bbfd4fb11018 #33
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 ./... | |