Merge pull request #1061 from emma646620-lgtm/feat/issue-837-add-infi… #400
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Contract Bindings Drift | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| bindings-drift: | |
| name: Regenerate TypeScript bindings and diff | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: "npm" | |
| cache-dependency-path: | | |
| package-lock.json | |
| frontend/package-lock.json | |
| - name: Setup Rust | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| target: wasm32-unknown-unknown | |
| - name: Cache Cargo dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| contracts/target | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo- | |
| - name: Install Stellar CLI | |
| run: bash scripts/install-stellar-cli.sh | |
| - name: Install root dependencies | |
| run: npm ci | |
| - name: Regenerate bindings | |
| run: | | |
| export PATH="$HOME/.local/bin:$PATH" | |
| npm run gen:bindings | |
| - name: Diff generated bindings | |
| run: | | |
| git status --short frontend/src/generated | |
| git diff --exit-code frontend/src/generated || { | |
| echo "::error::Generated TypeScript bindings are out of sync with the contract ABI."; | |
| echo "Run 'npm run gen:bindings' locally and commit the updated files in frontend/src/generated/."; | |
| exit 1; | |
| } |