ci-message-buffer-idl.yml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. - uses: pnpm/action-setup@v4
  38. name: Install pnpm
  39. - name: Install prettier globally
  40. run: pnpm install -g prettier@2.7.1
  41. - name: Run prettier (to avoid pre-commit failures)
  42. run: |
  43. pnpm dlx prettier@2.7.1 --write "./idl/*"
  44. - name: Check IDL changes
  45. # Fails if the IDL files are not up to date. Please use anchor build to regenerate the IDL files for
  46. # the current version of the contract and update idl directory.
  47. run: git diff --exit-code idl/*