diff --git a/.github/workflows/mainnet.yml b/.github/workflows/mainnet.yml new file mode 100644 index 0000000..c390a32 --- /dev/null +++ b/.github/workflows/mainnet.yml @@ -0,0 +1,60 @@ +name: Smart Contracts Testing +on: + pull_request: + branches: + - mainnet + push: + branches: + - mainnet + +jobs: + test: + name: Test Contracts + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Rust + uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + + - name: Install Sui CLI + uses: baptiste0928/cargo-install@v3 + with: + crate: sui + git: https://github.com/MystenLabs/sui.git + branch: mainnet + features: tracing + + - name: Run Sui Move tests + run: | + sui move test + + lint: + name: Lint Contracts + needs: test + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Rust + uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + + - name: Install Sui CLI + uses: baptiste0928/cargo-install@v3 + with: + crate: sui + git: https://github.com/MystenLabs/sui.git + branch: mainnet + features: tracing + + - name: Run Sui Move lints + run: | + sui move build --lint --warnings-are-errors \ No newline at end of file diff --git a/.github/workflows/testnet.yml b/.github/workflows/testnet.yml new file mode 100644 index 0000000..62b0f28 --- /dev/null +++ b/.github/workflows/testnet.yml @@ -0,0 +1,62 @@ +name: Smart Contracts Testing +on: + pull_request: + branches: + - main + - testnet + push: + branches: + - main + - testnet + +jobs: + test: + name: Test Contracts + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Rust + uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + + - name: Install Sui CLI + uses: baptiste0928/cargo-install@v3 + with: + crate: sui + git: https://github.com/MystenLabs/sui.git + branch: testnet + features: tracing + + - name: Run Sui Move tests + run: | + sui move test + + lint: + name: Lint Contracts + needs: test + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Rust + uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + + - name: Install Sui CLI + uses: baptiste0928/cargo-install@v3 + with: + crate: sui + git: https://github.com/MystenLabs/sui.git + branch: testnet + features: tracing + + - name: Run Sui Move lints + run: | + sui move build --lint --warnings-are-errors \ No newline at end of file diff --git a/.gitignore b/.gitignore index a007fea..a429920 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ build/* +.idea/* \ No newline at end of file