diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 5309c26fc8..21d56abe4e 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -37,7 +37,7 @@ jobs: - name: Generate code coverage run: | - ./tarpaulin.sh + ./scripts/tarpaulin.sh - name: Archive Tarpaulin code coverage results uses: actions/upload-artifact@v4 @@ -125,7 +125,7 @@ jobs: run: sh ./test/message-generator/test/translation-proxy-old-share/translation-proxy-old-share.sh - name: Coverage report - run: sh ./code-coverage-report.sh + run: sh ./scripts/code-coverage-report.sh - name: Archive MG code coverage results uses: actions/upload-artifact@v4 diff --git a/.github/workflows/sv2-header-check.yaml b/.github/workflows/sv2-header-check.yaml index 9d5149a781..732bd316b7 100644 --- a/.github/workflows/sv2-header-check.yaml +++ b/.github/workflows/sv2-header-check.yaml @@ -29,4 +29,4 @@ jobs: - name: Check sv2 header file is up to date with commit run: | echo Check sv2 header file is up to date with commit - sh ./sv2-header-check.sh + sh ./scripts/sv2-header-check.sh diff --git a/build_header.sh b/build_header.sh deleted file mode 100755 index 3d798731be..0000000000 --- a/build_header.sh +++ /dev/null @@ -1,17 +0,0 @@ -#! /bin/sh - -cargo install --version 0.20.0 cbindgen - -rm -f ./sv2.h -touch ./sv2.h - -dir=${1:-protocols} - -cd "$dir" - cbindgen --crate const_sv2 >> ../sv2.h - cbindgen --crate binary_codec_sv2 >> ../sv2.h - cbindgen --crate common_messages_sv2 >> ../sv2.h - cbindgen --crate template_distribution_sv2 >> ../sv2.h - cbindgen --crate codec_sv2 >> ../sv2.h - cbindgen --crate sv2_ffi >> ../sv2.h -cd .. diff --git a/examples/interop-cpp/README.md b/examples/interop-cpp/README.md index fff3df9f25..779b2fb37e 100644 --- a/examples/interop-cpp/README.md +++ b/examples/interop-cpp/README.md @@ -207,7 +207,7 @@ installation phase of `sv2_ffi` is replaced and `sv2.h` and the newly built `lib in the container (they are installed in `/gnu/store/[hash]-Rust-sv2_ffi-[version]/`). The manifest it expect to find `sv2.h` in the `sv2_ffi` package. Since the `sv2.h` is created manually with -`/build_header.sh`, it is very easy to commit code with an out of date header file. To ensure all commits include +`scripts/build_header.sh`, it is very easy to commit code with an out of date header file. To ensure all commits include the most updated header file, a GitHub Actions check is planned to be added. ## Install cbindgen diff --git a/examples/interop-cpp/run.sh b/examples/interop-cpp/run.sh index fe0dbdd18c..31f914e5d9 100755 --- a/examples/interop-cpp/run.sh +++ b/examples/interop-cpp/run.sh @@ -14,7 +14,7 @@ cargo build \ -p sv2_ffi && \ cp ../../protocols/target/release/libsv2_ffi.a ./ -../../build_header.sh ../../protocols && mv ../../sv2.h . +../../scripts/build_header.sh ../../protocols && mv ../../scripts/sv2.h . g++ -I ./ ./template-provider/template-provider.cpp libsv2_ffi.a -lpthread -ldl diff --git a/build-on-all-workspaces.sh b/scripts/build-on-all-workspaces.sh similarity index 100% rename from build-on-all-workspaces.sh rename to scripts/build-on-all-workspaces.sh diff --git a/scripts/build_header.sh b/scripts/build_header.sh new file mode 100755 index 0000000000..e0e20cd7e9 --- /dev/null +++ b/scripts/build_header.sh @@ -0,0 +1,17 @@ +#! /bin/sh + +cargo install --version 0.20.0 cbindgen + +rm -f ./scripts/sv2.h +touch ./scripts/sv2.h + +dir=${1:-../protocols} + +cd "$dir" + cbindgen --crate const_sv2 >> ../scripts/sv2.h + cbindgen --crate binary_codec_sv2 >> ../scripts/sv2.h + cbindgen --crate common_messages_sv2 >> ../scripts/sv2.h + cbindgen --crate template_distribution_sv2 >> ../scripts/sv2.h + cbindgen --crate codec_sv2 >> ../scripts/sv2.h + cbindgen --crate sv2_ffi >> ../scripts/sv2.h +cd .. diff --git a/check-versioning-lib-release.sh b/scripts/check-versioning-lib-release.sh similarity index 100% rename from check-versioning-lib-release.sh rename to scripts/check-versioning-lib-release.sh diff --git a/clippy-on-all-workspaces.sh b/scripts/clippy-on-all-workspaces.sh similarity index 100% rename from clippy-on-all-workspaces.sh rename to scripts/clippy-on-all-workspaces.sh diff --git a/code-coverage-report.sh b/scripts/code-coverage-report.sh similarity index 100% rename from code-coverage-report.sh rename to scripts/code-coverage-report.sh diff --git a/message-generator-tests.sh b/scripts/message-generator-tests.sh similarity index 100% rename from message-generator-tests.sh rename to scripts/message-generator-tests.sh diff --git a/mg-codecov-tests.sh b/scripts/mg-codecov-tests.sh similarity index 100% rename from mg-codecov-tests.sh rename to scripts/mg-codecov-tests.sh diff --git a/sv2-header-check.sh b/scripts/sv2-header-check.sh similarity index 96% rename from sv2-header-check.sh rename to scripts/sv2-header-check.sh index 6e04691433..b39b0af540 100755 --- a/sv2-header-check.sh +++ b/scripts/sv2-header-check.sh @@ -21,9 +21,10 @@ set -ex # cargo install cbindgen --force bts # cbindgen -V -cd ./protocols/v2/sv2-ffi +echo $PWD +cd protocols/v2/sv2-ffi SHA1_1=$(sha1sum sv2.h) -cd ../../.. +cd ../../../scripts BUILD_SCRIPT="./build_header.sh" sh ./"$BUILD_SCRIPT" diff --git a/sv2-publish.sh b/scripts/sv2-publish.sh similarity index 100% rename from sv2-publish.sh rename to scripts/sv2-publish.sh diff --git a/tarpaulin.sh b/scripts/tarpaulin.sh similarity index 100% rename from tarpaulin.sh rename to scripts/tarpaulin.sh