Skip to content

Commit

Permalink
Update go.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
DiegoDev2 authored Nov 26, 2024
1 parent 5764f49 commit 76c9d4e
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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

0 comments on commit 76c9d4e

Please sign in to comment.