-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
13 additions
and
7 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|