Skip to content

feat: add sui example #246

feat: add sui example

feat: add sui example #246

name: Run GMP Example Tests
on: pull_request
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04]
arch: [amd64]
steps:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
- name: Checkout code
uses: actions/checkout@v3
- name: Download and Install Aptos Binary
run: |
wget --no-check-certificate https://github.com/aptos-labs/aptos-core/releases/download/aptos-cli-v1.0.4/aptos-cli-1.0.4-Ubuntu-22.04-x86_64.zip
unzip aptos-cli-1.0.4-Ubuntu-22.04-x86_64.zip
sudo mv aptos /usr/local/bin
- name: Setup Dependencies for Sui Binary
run: sudo apt-get update && sudo apt-get install -y libpq-dev
- name: Download and Install Sui Binary
run: |
wget https://github.com/MystenLabs/sui/releases/download/devnet-v1.7.0/sui-devnet-v1.7.0-ubuntu-x86_64.tgz
tar -xvf sui-devnet-v1.7.0-ubuntu-x86_64.tgz
sudo mv ./target/release/sui-test-validator-ubuntu-x86_64 /usr/local/bin/sui-test-validator
sudo mv ./target/release/sui-ubuntu-x86_64 /usr/local/bin/sui
- name: Cleanup
run: rm -rf target aptos-cli-1.0.4-Ubuntu-22.04-x86_64.zip sui-devnet-v1.7.0-ubuntu-x86_64.tgz
- name: Install
run: npm ci
- name: Create .env file
run: |
# Dummy private key created for testing purpose only, it is not secret
npm run setup
- name: Compile EVM Smart Contracts
run: |
npm run build
- name: Compile Aptos Modules
run: |
npm run build-aptos
- name: Test
run: |
nohup sh -c "sui-test-validator" > nohup.out 2> nohup.err < /dev/null &
nohup sh -c "aptos node run-local-testnet --with-faucet" > nohup.out 2> nohup.err < /dev/null &
sleep 10
NODE_ENV=ci npm run test