ci-message-buffer-idl.yml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. name: Message Buffer IDL Check
  2. on:
  3. pull_request:
  4. paths:
  5. - pythnet/message_buffer/**
  6. push:
  7. branches:
  8. - main
  9. jobs:
  10. abi-check:
  11. name: Check Message Buffer IDL files are up to date
  12. runs-on: ubuntu-latest
  13. defaults:
  14. run:
  15. working-directory: pythnet/message_buffer
  16. steps:
  17. - name: Checkout sources
  18. uses: actions/checkout@v3
  19. - uses: Swatinem/rust-cache@v2
  20. with:
  21. workspaces: "pythnet/message_buffer -> target"
  22. - uses: actions-rs/toolchain@v1
  23. with:
  24. profile: minimal
  25. toolchain: 1.66.1
  26. components: rustfmt, clippy
  27. - name: Install Solana
  28. run: |
  29. wget http://nz2.archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb
  30. sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb
  31. sh -c "$(curl -sSfL https://release.solana.com/v1.14.18/install)"
  32. echo "/home/runner/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
  33. - name: Install Anchor
  34. run: |
  35. cargo install --git https://github.com/coral-xyz/anchor --tag v0.27.0 anchor-cli --locked
  36. - name: Build and generate IDLs
  37. run: anchor build
  38. - name: Copy anchor target files
  39. run: cp ./target/idl/message_buffer.json idl/ && cp ./target/types/message_buffer.ts idl/
  40. - uses: pnpm/action-setup@v4
  41. name: Install pnpm
  42. - name: Install prettier globally
  43. run: pnpm install -g prettier@2.7.1
  44. - name: Run prettier (to avoid pre-commit failures)
  45. run: |
  46. pnpm dlx prettier@2.7.1 --write "./idl/*"
  47. - name: Check IDL changes
  48. # Fails if the IDL files are not up to date. Please use anchor build to regenerate the IDL files for
  49. # the current version of the contract and update idl directory.
  50. run: git diff --exit-code idl/*