Update beckn_ci.yml

This commit is contained in:
AbhishekHS220
2025-03-11 14:22:38 +05:30
committed by GitHub
parent 23132c22ab
commit 783712f642

View File

@@ -32,16 +32,16 @@ jobs:
run: | run: |
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
# 4. Run golangci-lint on the entire APP_DIRECTORY (including subdirectories) # 4. Run golangci-lint on the entire APP_DIRECTORY (including subdirectories) ${{ env.APP_DIRECTORY }}
- name: Run golangci-lint - name: Run golangci-lint
run: | run: |
golangci-lint run ${{ env.APP_DIRECTORY }} golangci-lint run ./...
# 5. Run unit tests with coverage recursively for all Go files # 5. Run unit tests with coverage recursively for all Go files ${{ env.APP_DIRECTORY }}
- name: Run unit tests with coverage - name: Run unit tests with coverage
run: | run: |
# Run tests recursively for all Go files # Run tests recursively for all Go files
go test -v -coverprofile=coverage.out ${{ env.APP_DIRECTORY }}/... go test -v -coverprofile=coverage.out ./...
# Generate coverage report # Generate coverage report
go tool cover -func=coverage.out | tee coverage.txt go tool cover -func=coverage.out | tee coverage.txt
@@ -68,12 +68,12 @@ jobs:
fi fi
# 7. Build the Go code # 7. Build the Go code
- name: Build Go code #- name: Build Go code
run: | # run: |
go build -o myapp ${{ env.APP_DIRECTORY }}/... # go build -o myapp ${{ env.APP_DIRECTORY }}/...
if [ ! -f myapp ]; then # if [ ! -f myapp ]; then
echo "Build failed: myapp executable was not created." # echo "Build failed: myapp executable was not created."
exit 1 # exit 1
else # else
echo "Build succeeded: myapp executable created." # echo "Build succeeded: myapp executable created."
fi # fi