diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index aefa828..e8f6cae 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,11 +1,9 @@ -name: Build and Test +name: Build on: pull_request: - merge_group: push: branches: - - main - - release/** + - cp-main permissions: contents: read @@ -20,17 +18,6 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: "1.22.2" + go-version: "1.23.0" - name: Build - run: make build - - test: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version: "1.22.2" - - name: Test - run: make test + run: make diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 19c31aa..6d7037d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -3,8 +3,7 @@ on: pull_request: push: branches: - - main - - release/** + - cp-main permissions: contents: read @@ -16,6 +15,6 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: "1.22.2" + go-version: "1.23.0" - name: Run Linter run: make lint \ No newline at end of file diff --git a/Makefile b/Makefile index 8a8c245..29c7bc5 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,9 @@ WALLET_BIN := build/wallet +GOLANGCI_VERSION := v1.60.3 .PHONY: demo run clean -.DEFAULT_GOAL := build +.DEFAULT_GOAL := build-wallet # Build the wallet command build-wallet: @@ -15,4 +16,22 @@ demo: # Clean built binaries clean: - rm -f $(WALLET_BIN) \ No newline at end of file + rm -f $(WALLET_BIN) + + +# Install golangci-lint +lint-install: + @echo "--> Installing golangci-lint $(GOLANGCI_VERSION)" + @go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_VERSION) + +# Run golangci-lint +lint: + @echo "--> Running linter" + $(MAKE) lint-install + @golangci-lint run --timeout=15m + +# Run golangci-lint and fix +lint-fix: + @echo "--> Running linter with fix" + $(MAKE) lint-install + @golangci-lint run --fix \ No newline at end of file