ci.yml 691 B

1234567891011121314151617181920212223242526
  1. name: Continuous Integration
  2. on:
  3. pull_request:
  4. push:
  5. branches:
  6. - main
  7. jobs:
  8. GO:
  9. runs-on: ubuntu-latest
  10. steps:
  11. - uses: actions/checkout@v4
  12. - uses: actions/setup-go@v5
  13. with:
  14. go-version: '1.21'
  15. - run: sudo apt install -y libsystemd-dev
  16. - name: gofmt -l .
  17. run: files=$(gofmt -l .); if [[ -n "$files" ]]; then echo "$files"; exit 1; fi
  18. - name: goimports -l .
  19. run: |
  20. go install golang.org/x/tools/cmd/goimports@latest
  21. files=$(goimports -l .); if [[ -n "$files" ]]; then echo "$files"; exit 1; fi
  22. - run: go vet ./...
  23. - run: go test ./...
  24. - run: go build -mod=readonly .