ci-message-buffer-idl.yml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. name: Message Buffer IDL Check
  2. on:
  3. pull_request:
  4. paths:
  5. - pythnet/message_buffer/**
  6. push:
  7. branches:
  8. - main
  9. paths:
  10. - pythnet/message_buffer/**
  11. jobs:
  12. abi-check:
  13. name: Check Message Buffer IDL files are up to date
  14. runs-on: ubuntu-latest
  15. defaults:
  16. run:
  17. working-directory: pythnet/message_buffer
  18. steps:
  19. - name: Checkout sources
  20. uses: actions/checkout@v3
  21. - uses: actions-rs/toolchain@v1
  22. with:
  23. profile: minimal
  24. toolchain: nightly-2023-03-01
  25. components: rustfmt, clippy
  26. - name: Install Solana
  27. run: |
  28. sh -c "$(curl -sSfL https://release.solana.com/v1.14.18/install)"
  29. echo "/home/runner/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
  30. - name: Install Anchor
  31. run: |
  32. cargo install --git https://github.com/coral-xyz/anchor --tag v0.27.0 anchor-cli --locked
  33. - name: Build and generate IDLs
  34. run: anchor build
  35. - name: Copy anchor target files
  36. run: cp ./target/idl/message_buffer.json idl/ && cp ./target/types/message_buffer.ts idl/
  37. - name: Run prettier (to avoid pre-commit failures)
  38. run: |
  39. npx prettier --write "./idl/*"
  40. - name: Check IDL changes
  41. # Fails if the IDL files are not up to date. Please use anchor build to regenerate the IDL files for
  42. # the current version of the contract and update idl directory.
  43. run: git diff --exit-code idl/*