-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6ef2ac0
commit e62c2f4
Showing
2 changed files
with
116 additions
and
0 deletions.
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,67 @@ | ||
name: mvr-cli Rust CI | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
branches: ["main"] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
continue-on-error: true | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: rust version | ||
run: | | ||
rustc --version | ||
cargo --version | ||
- uses: taiki-e/install-action@cargo-nextest | ||
|
||
- name: Build mvr-cli (debug) | ||
run: | | ||
cd mvr-cli | ||
cargo build | ||
yecho "$(pwd)/target/debug" >> $GITHUB_PATH | ||
- name: Run mvr-cli tests | ||
run: | | ||
cd mvr-cli | ||
cargo nextest run | ||
- name: Get Sui releases JSON file | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
shell: bash | ||
run: | | ||
curl \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "Authorization: Bearer $GITHUB_TOKEN" \ | ||
-L -o releases.json \ | ||
https://api.github.com/repos/MystenLabs/sui/releases | ||
- name: Get the latest Sui testnet binary and add it to PATH | ||
shell: bash | ||
run: | | ||
os=${{runner.os}} | ||
binary_os="" | ||
if [ $os == "Linux" ]; then | ||
binary_os="ubuntu" | ||
fi | ||
testnet_url=$(cat releases.json | jq --arg os $binary_os '.[] | .assets[] | select(.name | contains("testnet")) | select(.name | contains($os)) | select(.name | contains("x86"))'| jq -csr '.[0] | .browser_download_url') | ||
filename="sui-$binary_os.tar.gz" | ||
echo "Downloading testnet binary from $testnet_url" | ||
wget -q $testnet_url -O $filename | ||
tar -zxvf $filename ./sui | ||
echo "$(pwd)" >> $GITHUB_PATH | ||
- name: Run custom integration test | ||
run: | | ||
chmod +x ./ci/integration_test.sh | ||
./ci/integration_test.sh |
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,49 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
command_exists() { | ||
command -v "$1" >/dev/null 2>&1 | ||
} | ||
|
||
if ! command_exists curl; then | ||
echo "Error: curl is not installed. Please install curl and try again." | ||
exit 1 | ||
fi | ||
|
||
########################################################## | ||
# Demo Package set up (depends on on-chain package data) # | ||
########################################################## | ||
mkdir -p demo-package/sources | ||
|
||
cat << EOF > demo-package/sources/demo.move | ||
module nftmaker::nftmaker { | ||
use demo::demo; | ||
public fun new(): u64 { | ||
return demo::num() | ||
} | ||
} | ||
EOF | ||
|
||
cat << EOF > demo-package/Move.toml | ||
[package] | ||
name = "nftmaker" | ||
edition = "2024.beta" | ||
[dependencies] | ||
Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "framework/mainnet" } | ||
demo = { r.mvr = "@mvr-tst/first-app" } | ||
[addresses] | ||
nftmaker = "0x0" | ||
[r.mvr] | ||
network = "mainnet" | ||
EOF | ||
|
||
########################################### | ||
# Invokes `mvr` when building the package # | ||
########################################### | ||
echo "Building package..." | ||
cd demo-package | ||
sui move build | ||
|