From 9a1f12504a34dbd7720b7c1a3f12a23ea7806f4a Mon Sep 17 00:00:00 2001 From: upsaurav12 Date: Sun, 18 Jan 2026 22:35:00 +0530 Subject: [PATCH] fix: ci.yaml --- .github/workflows/ci.yml | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 64f0190..cdfc73f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Go +name: Go CI on: push: @@ -7,8 +7,9 @@ on: branches: [ main ] jobs: - build-and-test: + ci: runs-on: ubuntu-latest + steps: - name: Checkout code uses: actions/checkout@v4 @@ -16,10 +17,26 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: '1.22' # Adjust to match your go.mod + go-version-file: go.mod + cache: true - - name: Install dependencies - run: go mod tidy + # Ensures go.mod/go.sum are clean + - name: Verify dependencies + run: | + go mod tidy + git diff --exit-code - name: Run tests - run: go test ./... \ No newline at end of file + run: | + go test ./... -race -count=1 + + - name: Run tests with coverage + run: | + go test ./... -coverprofile=coverage.out + go tool cover -func=coverage.out + + - name: Lint + uses: golangci/golangci-lint-action@v6 + with: + version: latest + args: --timeout=5m