run-tests.yml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. name: Run Bolt Tests
  2. on:
  3. push:
  4. branches:
  5. - main
  6. pull_request:
  7. branches:
  8. - main
  9. env:
  10. solana_version: v2.2.20
  11. jobs:
  12. setup:
  13. runs-on: ubuntu-latest
  14. steps:
  15. - uses: actions/checkout@v4
  16. - uses: actions/setup-node@v4
  17. with:
  18. node-version: 21
  19. - name: Install Essentials
  20. run: |
  21. sudo apt-get update
  22. sudo apt-get install -y pkg-config build-essential libudev-dev
  23. npm install --global yarn
  24. - name: Cache Node Dependencies
  25. uses: actions/cache@v3
  26. with:
  27. path: '**/node_modules'
  28. key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
  29. - name: Install Rust
  30. uses: dtolnay/rust-toolchain@stable
  31. with:
  32. toolchain: stable
  33. - name: Cache Rust
  34. uses: Swatinem/rust-cache@v2
  35. - name: Install Solana
  36. run: |
  37. sh -c "$(curl -sSfL https://release.anza.xyz/${{ env.solana_version }}/install)"
  38. export PATH="$HOME/.local/share/solana/install/active_release/bin:$PATH"
  39. echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
  40. solana --version
  41. test:
  42. needs: setup
  43. runs-on: ubuntu-latest
  44. steps:
  45. - uses: actions/checkout@v4
  46. - name: Install Rust
  47. uses: dtolnay/rust-toolchain@stable
  48. with:
  49. toolchain: stable
  50. - name: Cache Rust
  51. uses: Swatinem/rust-cache@v2
  52. - name: Install Solana
  53. run: |
  54. sh -c "$(curl -sSfL https://release.anza.xyz/${{ env.solana_version }}/install)"
  55. export PATH="$HOME/.local/share/solana/install/active_release/bin:$PATH"
  56. echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
  57. solana --version
  58. - name: Install Ephemeral Validator
  59. run: |
  60. npm install --global @magicblock-labs/ephemeral-validator
  61. - name: Create keypair
  62. run: |
  63. export PATH="$HOME/.local/share/solana/install/active_release/bin:$PATH"
  64. solana --version
  65. solana-keygen new --silent --no-bip39-passphrase
  66. - name: Set Deployment Keys
  67. run: |
  68. mkdir -p target/deploy
  69. echo ${{ secrets.WORLD }} > target/deploy/world-keypair.json
  70. echo ${{ secrets.BOLT_COMPONENT }} > target/deploy/bolt_component-keypair.json
  71. echo ${{ secrets.BOLT_SYSTEM }} > target/deploy/bolt_system-keypair.json
  72. echo ${{ secrets.COMPONENT_POSITION }} > target/deploy/component_position-keypair.json
  73. echo ${{ secrets.COMPONENT_VELOCITY }} > target/deploy/component_velocity-keypair.json
  74. echo ${{ secrets.SYSTEM_APPLY_VELOCITY }} > target/deploy/system_apply_velocity-keypair.json
  75. echo ${{ secrets.SYSTEM_FLY }} > target/deploy/system_fly-keypair.json
  76. echo ${{ secrets.SYSTEM_SIMPLE_MOVEMENT }} > target/deploy/system_simple_movement-keypair.json
  77. - name: Run Build and Tests
  78. run: |
  79. cargo install --path crates/bolt-cli --force --locked
  80. yarn install
  81. bolt build
  82. cd clients/typescript
  83. yarn install && yarn build
  84. cd ../..
  85. bolt test