on:
  pull_request:
    paths:
      - target_chains/sui/contracts/**
  push:
    branches:
      - main

name: Sui Contracts

jobs:
  sui-tests:
    name: Sui tests
    runs-on: ubuntu-latest
    defaults:
      run:
        working-directory: target_chains/sui/contracts/
    steps:
      - uses: actions/checkout@v3
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: 1.77.0
          override: true
      - uses: taiki-e/cache-cargo-install-action@v2
        with:
          tool: sui
          git: https://github.com/MystenLabs/sui.git
          rev: 041c5f2bae2fe52079e44b70514333532d69f4e6

      - name: Run tests
        run: sui move test
