-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* checking what files exist * properly running coverage * try devnet 1.25.0 * trying to do use sui-debug instead * delete sui * try to move debug instead * ls to see what is created * try copying the correct files * trying some more things * fix a bug * update .gitignore * try uploading .trace * try uploading mvcov * faster action * debug * test * update README * switch binary name * add coverage script * also show coverage sources * fix file path --------- Co-authored-by: Milap Sheth <[email protected]>
- Loading branch information
1 parent
710e400
commit c705d1d
Showing
5 changed files
with
118 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Code Coverage | ||
on: pull_request | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
coverage: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Setup Dependencies for Sui Binary | ||
run: sudo apt-get update && sudo apt-get install -y libpq-dev | ||
|
||
- name: Download and Install Sui | ||
env: | ||
SUI_VERSION: devnet-v1.25.0 | ||
run: | | ||
curl -L -o sui-${SUI_VERSION}-ubuntu-x86_64.tgz https://github.com/MystenLabs/sui/releases/download/${SUI_VERSION}/sui-${SUI_VERSION}-ubuntu-x86_64.tgz | ||
tar -xvf sui-${SUI_VERSION}-ubuntu-x86_64.tgz | ||
sudo mv ./sui-test-validator /usr/local/bin/sui-test-validator | ||
sudo mv ./sui /usr/local/bin/sui | ||
sudo mv ./sui-debug /usr/local/bin/sui-debug | ||
rm -rf sui-${SUI_VERSION}-ubuntu-x86_64.tgz | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
cache: 'npm' | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Build | ||
run: npm run build | ||
|
||
- name: Test | ||
run: npm run coverage | ||
|
||
- name: Display coverage report | ||
run: cat ./.coverage.info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/sh | ||
|
||
export SUI=sui-debug | ||
|
||
# Check if sui-debug is available | ||
if ! type "$SUI" >/dev/null 2>&1; then | ||
echo "sui-debug not found. Setting SUI to ./sui/target/debug/sui." | ||
|
||
# Default to a local Sui build | ||
export SUI="./sui/target/debug/sui" | ||
|
||
# Check if the file exists | ||
if [ ! -f "$SUI" ]; then | ||
echo "Error: $SUI not found. Exiting." | ||
exit 1 | ||
fi | ||
fi | ||
|
||
echo 'Axelar Move Coverage Report' > .coverage.info | ||
echo '' >> .coverage.info | ||
|
||
for d in ./move/*/; do | ||
"$SUI" move test --path "$d" --coverage & | ||
done | ||
|
||
wait | ||
|
||
for d in ./move/*/; do | ||
echo "Generating coverage info for package $d" | ||
|
||
if [ ! -f "$d/.coverage_map.mvcov" ]; then | ||
echo "\n NO tests found for module $d. Skipped.\n" >> .coverage.info | ||
continue | ||
fi | ||
|
||
echo "\nCoverage report for module $d\n" >> .coverage.info | ||
|
||
"$SUI" move coverage summary --path "$d" >> .coverage.info | ||
|
||
# Display source code with coverage info | ||
find "$d/sources" -type f -name '*.move' | while IFS= read -r f; do | ||
"$SUI" move coverage source --path "$d" --module "$(basename "$f" .move)" | ||
done | ||
done |