Merge pull request #48 from DiegoDev2/fix/ci #19
This file contains 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: Fleet CI | |
on: | |
pull_request: | |
branches: [ "main" ] | |
push: | |
branches: [ "main" ] | |
jobs: | |
Fleet: | |
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 | |
# 4. Check for required directories (ignore error) | |
- name: Check module structure | |
run: | | |
if [ ! -d "./cli" ] || [ ! -d "./formulas" ]; then | |
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 | |
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 |