|
| 1 | +name: Sphinx contracts |
| 2 | +on: |
| 3 | + merge_group: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - "main" |
| 7 | + pull_request: |
| 8 | + types: [ opened, synchronize, reopened, ready_for_review ] |
| 9 | + |
| 10 | +jobs: |
| 11 | + solidity: |
| 12 | + runs-on: warp-ubuntu-latest-x64-16x |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v4 |
| 15 | + - name: Install Foundry |
| 16 | + uses: foundry-rs/foundry-toolchain@v1 |
| 17 | + with: |
| 18 | + version: nightly |
| 19 | + - name: Check formatting |
| 20 | + run: | |
| 21 | + forge fmt --check |
| 22 | + working-directory: ${{ github.workspace }}/solidity/ |
| 23 | + - name: Run Forge build |
| 24 | + run: | |
| 25 | + forge --version |
| 26 | + forge build |
| 27 | + working-directory: ${{ github.workspace }}/solidity/ |
| 28 | + - name: Run Forge tests |
| 29 | + run: | |
| 30 | + forge test |
| 31 | + working-directory: ${{ github.workspace }}/solidity/ |
| 32 | + |
| 33 | + move: |
| 34 | + runs-on: warp-ubuntu-latest-x64-16x |
| 35 | + steps: |
| 36 | + - uses: actions/checkout@v4 |
| 37 | + - name: Install Move |
| 38 | + run: | |
| 39 | + python3 --version |
| 40 | + curl -fsSL "https://aptos.dev/scripts/install_cli.py" | python3 |
| 41 | + echo "PATH=$HOME/.local/bin:$PATH" | tee -a $GITHUB_ENV |
| 42 | + - name: Check Aptos account balance |
| 43 | + id: check_balance |
| 44 | + run: | |
| 45 | + balance_output=$(aptos account balance --profile testnet) |
| 46 | + echo "Balance output: $balance_output" |
| 47 | + |
| 48 | + balance=$(echo $balance_output | jq '.Result[0].balance') |
| 49 | + echo "Balance value: $balance" |
| 50 | + |
| 51 | + if [ "$balance" -lt 100000000 ]; then |
| 52 | + echo "Balance is below threshold. Funding the account..." |
| 53 | + aptos account fund-with-faucet --profile testnet |
| 54 | + else |
| 55 | + echo "Balance is sufficient. No action needed." |
| 56 | + fi |
| 57 | + working-directory: ${{ github.workspace }}/move |
| 58 | + - name: Run unit tests |
| 59 | + run: | |
| 60 | + aptos move test --named-addresses plonk_verifier_addr=testnet |
| 61 | + working-directory: ${{ github.workspace }}/move |
| 62 | + - name: Publish |
| 63 | + run: | |
| 64 | + aptos move publish --named-addresses plonk_verifier_addr=testnet --profile testnet --assume-yes |
| 65 | + working-directory: ${{ github.workspace }}/move |
0 commit comments