From 4939a608f1384ab2341d32cde121f75441b46755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BF=97=E5=AE=87?= Date: Wed, 31 Jan 2024 18:02:23 +0800 Subject: [PATCH] main: fix Makefile --- .github/workflows/go.yml | 15 +++++++++++++-- Makefile | 13 +++++++------ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 5d0f5a09..6dcc92b6 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -13,6 +13,10 @@ jobs: strategy: matrix: go: ["1.20", "1.21"] + rust: + - version: stable + clippy: true + - version: 1.72.0 # As specified in rust-toolchain steps: - uses: actions/checkout@v3 @@ -21,11 +25,18 @@ jobs: with: go-version: ${{ matrix.go }} + - name: Install Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.rust.version }} + override: true + profile: minimal + - name: Build - run: go build -v ./... + run: make all - name: Install Linters run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.2 - name: Test - run: sh ./goclean.sh + run: make test diff --git a/Makefile b/Makefile index 73a1ae4c..b7b9e20b 100644 --- a/Makefile +++ b/Makefile @@ -4,26 +4,27 @@ help: ## Display help install-rust: ## Install rust if not installed if ! type cargo &> /dev/null; then curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh; fi -install-uniffi-bindgen-go: install-rust ## Install uniffi-bindgen-go if not installed - if ! type uniffi-bindgen-go &> /dev/null; then cargo install uniffi-bindgen-go --git https://github.com/NordSecurity/uniffi-bindgen-go --tag v0.2.0+v0.25.0; fi +install-uniffi-bindgen-go: #install-rust ## Install uniffi-bindgen-go if not installed + #if ! type uniffi-bindgen-go &> /dev/null; then + cargo install uniffi-bindgen-go --git https://github.com/NordSecurity/uniffi-bindgen-go --tag v0.2.0+v0.25.0 #; fi build-bdk: install-uniffi-bindgen-go ## Build BDK static library uniffi-bindgen-go -o bdkwallet bdkwallet/bdkgo_crate/src/bdkgo.udl cargo build --release build-utreexod: build-bdk ## Build utreexod with all features - go build ./... --tags=bdkwallet + go build --tags=bdkwallet ./... build-utreexod-without-bdk: ## Build utreexod without BDK wallet go build ./... -test: +test: build-bdk ## Run all test cargo test sh ./goclean.sh -all: build-bdk build-utreexod +all: build-bdk build-utreexod ## Build all -clean: +clean: ## Clean all rm utreexod go clean cargo clean