From 76c9d4e69c2f63c4a3dd1c56aad2f4c3a8942fa7 Mon Sep 17 00:00:00 2001 From: DiegoDev <144474823+DiegoDev2@users.noreply.github.com> Date: Mon, 25 Nov 2024 23:48:10 -0400 Subject: [PATCH] Update go.yml --- .github/workflows/go.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 769919f1..3b9face1 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -11,39 +11,45 @@ jobs: runs-on: ubuntu-latest steps: + # 1. Checkout the code - uses: actions/checkout@v3 + # 2. Set up Go environment - name: Setup Go environment uses: actions/setup-go@v5.1.0 with: go-version: 1.23.x - + # 3. Verify Go version - name: Check Go environment run: go version - - name: Ensure module structure + # 4. Check for required directories (ignore error) + - name: Check module structure run: | if [ ! -d "./cli" ] || [ ! -d "./formulas" ]; then - echo "Error: cli or formulas directory is missing." - exit 1 + echo "Warning: cli or formulas directory is missing, but continuing..." fi + # 5. Clean and install dependencies - name: Install dependencies run: | go clean -modcache - go mod tidy || true - go get -v -t ./... || true + go mod tidy + go get -v -t ./... + # 6. Verify imports and build module - name: Verify imports run: go build ./... + # 7. Install golangci-lint for linting - name: Install golangci-lint run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest + # 8. Run linter - name: Run golangci-lint run: golangci-lint run ./... + # 9. Build the project - name: Build run: go build -o resq -