chore: codebase optimization — reduce duplication, modernize Go, add linting and tests #57
Workflow file for this run
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.24' | |
| - name: Download dependencies | |
| run: go mod download | |
| - name: Check formatting | |
| run: test -z "$(gofmt -l .)" || (gofmt -l . && exit 1) | |
| - name: Run go vet | |
| run: go vet ./... | |
| - name: Run tests | |
| run: go test ./... -short -race | |
| - name: Check vulnerabilities | |
| run: go install golang.org/x/vuln/cmd/govulncheck@latest && govulncheck ./... | |
| - name: Build | |
| run: go build ./cmd/nylas | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.24' | |
| - name: Run golangci-lint | |
| uses: golangci/golangci-lint-action@v6 | |
| with: | |
| version: latest | |
| args: --timeout=5m |