diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index a9628df65d..86347b70e0 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -50,7 +50,7 @@ jobs: command: test args: -p starcoin-move-prover - name: check changed files - run: bash ./scripts/changed-files.sh + run: bash ./scripts/changed_files.sh - name: integration test dev environment env: RUST_LOG: info diff --git a/scripts/changed_files.ps1 b/scripts/changed_files.ps1 new file mode 100644 index 0000000000..0f831ce4fd --- /dev/null +++ b/scripts/changed_files.ps1 @@ -0,0 +1,5 @@ +$diff=$(git diff) +Write-Host "$diff" + +$changed_files=$(git status --porcelain) +Write-Host "$changed_files" diff --git a/scripts/changed-files.sh b/scripts/changed_files.sh old mode 100755 new mode 100644 similarity index 100% rename from scripts/changed-files.sh rename to scripts/changed_files.sh diff --git a/scripts/check_commit.ps1 b/scripts/check_commit.ps1 new file mode 100644 index 0000000000..6f468bb35d --- /dev/null +++ b/scripts/check_commit.ps1 @@ -0,0 +1,16 @@ +$STARCOIN_DIR = (get-item $PSScriptRoot).parent.FullName + +# cargo fmt check +cargo fmt -- --check +# cargo clippy check +cargo clippy --all-targets -- -D warnings +# generate stdlib +cargo run -p stdlib +# generate genesis +cargo run -p starcoin-genesis +# generate rpc schema document +cargo run -p starcoin-rpc-api -- -d ./rpc/generated_rpc_schema +# test config file +cargo test -p starcoin-config test_example_config_compact +# check changed files +. "${STARCOIN_DIR}/scripts/changed_files.ps1" diff --git a/scripts/check_commit.sh b/scripts/check_commit.sh index 29b57b7e16..2a4231b8f8 100755 --- a/scripts/check_commit.sh +++ b/scripts/check_commit.sh @@ -19,4 +19,4 @@ cargo run -p starcoin-rpc-api -- -d ./rpc/generated_rpc_schema # test config file cargo test -p starcoin-config test_example_config_compact # check changed files -"${STARCOIN_DIR}"/scripts/changed-files.sh +"${STARCOIN_DIR}"/scripts/changed_files.sh