|
88 | 88 | env: |
89 | 89 | JSON_RPC_ENDPOINT: http://127.0.0.1:8545 |
90 | 90 | MNEMONIC: guard cream sadness conduct invite crumble clock pudding hole grit liar hotel maid produce squeeze return argue turtle know drive eight casino maze host |
| 91 | + |
| 92 | + sai-trading: |
| 93 | + runs-on: ubuntu-latest |
| 94 | + steps: |
| 95 | + - uses: actions/checkout@v4 |
| 96 | + |
| 97 | + - name: "Check for EVM-related changes" |
| 98 | + id: check_changes |
| 99 | + uses: dorny/paths-filter@v3 |
| 100 | + with: |
| 101 | + filters: | |
| 102 | + check_changes: |
| 103 | + - "sai-trading/**/*.ts" |
| 104 | + - "sai-trading/artifacts/*" |
| 105 | + - "sai-trading/**/*.go" |
| 106 | +
|
| 107 | + - name: Set up Go |
| 108 | + if: steps.check_changes.outputs.check_changes == 'true' |
| 109 | + uses: actions/setup-go@v5 |
| 110 | + with: |
| 111 | + go-version: 1.24 |
| 112 | + # cache: "The action has a built-in functionality for caching and |
| 113 | + # restoring go modules and build outputs. It uses [actions/cache@v4]." |
| 114 | + # - Handles go module cache (go env GOMODCACHE). |
| 115 | + # - Handles go build cache (go env GOCACHE). |
| 116 | + cache: true |
| 117 | + |
| 118 | + - name: "Install just" |
| 119 | + if: steps.check_changes.outputs.check_changes == 'true' |
| 120 | + # casey/just: https://just.systems/man/en/chapter_6.html |
| 121 | + # taiki-e/install-action: https://github.com/taiki-e/install-action |
| 122 | + uses: taiki-e/install-action@just |
| 123 | + |
| 124 | + - name: "Build the nibid binary" |
| 125 | + if: steps.check_changes.outputs.check_changes == 'true' |
| 126 | + run: | |
| 127 | + just install |
| 128 | +
|
| 129 | + - if: steps.check_changes.outputs.check_changes == 'true' |
| 130 | + # For running things and for package management " |
| 131 | + uses: oven-sh/setup-bun@v1 |
| 132 | + with: |
| 133 | + bun-version: 1.2.22 # Values: latest, <sha>, 1.2.3, canary |
| 134 | + # Outputs: |
| 135 | + # - cache-hit : Whether the executable was read from cache. Ex. "true" |
| 136 | + # - bun-version : The output from running `bun-version`. Ex. "1.0.0" |
| 137 | + # - bun-revision : The output from running `bun-revision`. |
| 138 | + |
| 139 | + - if: steps.check_changes.outputs.check_changes == 'true' |
| 140 | + working-directory: "sai-trading" |
| 141 | + run: | |
| 142 | + bun install |
| 143 | +
|
| 144 | + - if: steps.check_changes.outputs.check_changes == 'true' |
| 145 | + run: | |
| 146 | + just localnet --no-build & |
| 147 | + sleep 10 |
| 148 | +
|
| 149 | + - if: steps.check_changes.outputs.check_changes == 'true' |
| 150 | + working-directory: "sai-trading" |
| 151 | + run: | |
| 152 | + just test |
0 commit comments