go.yml 962 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # This workflow will build a golang project
  2. # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
  3. name: Go
  4. on:
  5. push:
  6. branches: [ "main" ]
  7. pull_request:
  8. branches: [ "main" ]
  9. jobs:
  10. build:
  11. runs-on: ubuntu-latest
  12. steps:
  13. - uses: actions/checkout@v4
  14. - name: Set up Go
  15. uses: actions/setup-go@v5
  16. with:
  17. go-version: '1.22'
  18. - name: Go Format
  19. run: |
  20. gofmt -s -l .
  21. if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi
  22. - name: Go Vet
  23. run: go vet ./...
  24. - name: Build
  25. run: go build -v ./...
  26. - name: Test
  27. run: go test -v -race -coverprofile=coverage.out -covermode=atomic ./...
  28. - name: Upload coverage reports to Codecov
  29. uses: codecov/codecov-action@v4.0.1
  30. with:
  31. token: ${{ secrets.CODECOV_TOKEN }}
  32. slug: mk6i/retro-aim-server