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-rust-lang/setup-rust-toolchain@v1
        with:
          rustflags: ""
      - name: install sui
        run: |
          # This version doesn't build with newer Rust
          cargo +1.79.0 install -f sui --locked \
            --git https://github.com/MystenLabs/sui.git \
            --rev 041c5f2bae2fe52079e44b70514333532d69f4e6
      - name: Run tests
        run: sui move test
