Skip to content

code refactoring

code refactoring #1

name: TypeScript Integration Tests
on:
pull_request:
merge_group:
branches: [main]
env:
CARGO_TERM_COLOR: always
GITHUB_ACTIONS: true
APTOS_NETWORK: local
ARTIFACTS_LEVEL: all
PYTH_HERMES_URL: https://hermes-beta.pyth.network
PYTH_CONTRACT_ACCOUNT: 0x0
PYTH_DEPLOYER_ACCOUNT: 0x0
PYTH_WORMHOLE: 0x0
jobs:
typescript-integration-tests:
name: Run Typescript Integration Tests
runs-on: ubuntu-latest
timeout-minutes: 60
env:
DEFAULT_FUNDER_PRIVATE_KEY: ${{ secrets.GH_DEFAULT_FUNDER_PRIVATE_KEY }}
steps:
- uses: actions/checkout@v4
- name: Install Aptos CLI
run: |
curl -fsSL "https://aptos.dev/scripts/install_cli.py" | python3
aptos --version # Verify that Aptos CLI is installed
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install npm dependencies
run: pnpm install
working-directory: test-suites
- name: Run Aptos Create Local Testnet
run: |
make local-testnet &
echo $! > aptos_serve_pid.txt
- name: Wait for Aptos Local Testnet to be ready
run: |
sleep 20
- name: Set Local Aptos Workspace Config
run: make set-workspace-config
- name: Init Local Aptos Workspace Config
run: make init-workspace-config
- name: Run Aptos Create Profiles
run: make init-profiles
- name: Run Aptos Create Test Profiles
run: make init-test-profiles
- name: Run Aptos Fund Profiles
run: make fund-profiles
- name: Run Aptos Fund Test Profiles
run: make fund-test-profiles
- name: Run Aptos Compile All Contracts
run: make compile-all
- name: Run Aptos Publish All Contracts
run: make publish-all
- name: Run init test data
run: pnpm run init-data
working-directory: test-suites
- name: Run integration tests logic
run: pnpm run test:logic
working-directory: test-suites
- name: Terminate Aptos Local Testnet
if: always()
run: |
kill $(cat aptos_serve_pid.txt) || true