Skip to content

Commit

Permalink
Move scripts to a folder
Browse files Browse the repository at this point in the history
  • Loading branch information
jbesraa authored and plebhash committed Jun 30, 2024
1 parent 29c9acc commit aaa5a3c
Show file tree
Hide file tree
Showing 15 changed files with 25 additions and 24 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sv2-header-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
17 changes: 0 additions & 17 deletions build_header.sh

This file was deleted.

2 changes: 1 addition & 1 deletion examples/interop-cpp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/interop-cpp/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
File renamed without changes.
17 changes: 17 additions & 0 deletions scripts/build_header.sh
Original file line number Diff line number Diff line change
@@ -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 ..
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 3 additions & 2 deletions sv2-header-check.sh → scripts/sv2-header-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit aaa5a3c

Please sign in to comment.