diff --git a/.editorconfig b/.editorconfig index 517079a..37f22fc 100644 --- a/.editorconfig +++ b/.editorconfig @@ -23,3 +23,7 @@ trim_trailing_whitespace = false # Use tabs for indentation (Makefiles require tabs) [{Makefile,**.mk}] indent_style = tab + +[.github/workflows/*.{yml, yaml}] +indent_style = space +indent_size = 2 diff --git a/.github/workflows/dusk_ci.yaml b/.github/workflows/dusk_ci.yaml new file mode 100644 index 0000000..661ea40 --- /dev/null +++ b/.github/workflows/dusk_ci.yaml @@ -0,0 +1,22 @@ +on: [pull_request] + +name: Continuous integration + +# Jobs run on core +jobs: + dusk_analysis: + name: Dusk Analyzer + uses: dusk-network/.github/.github/workflows/dusk-analysis.yml@main + + #code_analysis: + # name: Code Analysis + # uses: dusk-network/.github/.github/workflows/code-analysis.yml@main + # with: + # clippy_default: false + # clippy_args: --features=rkyv/size_32 + + #test: + # name: Run tests + # uses: dusk-network/.github/.github/workflows/run-tests.yml@main + # with: + # test_flags: --features=rkyv-impl,size_32 diff --git a/Makefile b/Makefile index 3b330d8..6341f49 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,16 @@ COMPILER_VERSION=v0.2.0 -all: contract +all: contract ## Build everything -test: contract test-contract +help: ## Display this help screen + @grep -h \ + -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \ + awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' + +test: contract test-contract ## Run the tests @cargo test --release --manifest-path=tests/Cargo.toml -contract: setup-compiler +contract: setup-compiler ## Compile the contract @RUSTFLAGS="-C link-args=-zstack-size=65536" \ cargo +dusk build \ --release \ @@ -20,7 +25,7 @@ contract: setup-compiler target/wasm64-unknown-unknown/release/% \ build/% -test-contract: setup-compiler +test-contract: setup-compiler ## Compile the test-contract @RUSTFLAGS="-C link-args=-zstack-size=65536" \ cargo +dusk build \ --release \ @@ -35,10 +40,10 @@ test-contract: setup-compiler target/wasm64-unknown-unknown/release/% \ build/% -setup-compiler: +setup-compiler: ## Run the setup-compiler script @./scripts/setup-compiler.sh $(COMPILER_VERSION) -clean: +clean: ## Clean the build artifacts @cargo clean @rm -rf build diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 0000000..3450fc4 --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1,2 @@ +max_width = 80 +wrap_comments = true