run-tests.yml 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. name: Run Bolt Tests
  2. on:
  3. push:
  4. branches:
  5. - main
  6. pull_request_target:
  7. branches:
  8. - main
  9. env:
  10. solana_version: v1.18.15
  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.solana.com/${{ 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.solana.com/${{ 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: Create keypair
  59. run: |
  60. export PATH="$HOME/.local/share/solana/install/active_release/bin:$PATH"
  61. solana --version
  62. solana-keygen new --silent --no-bip39-passphrase
  63. - name: Set Deployment Keys
  64. run: |
  65. mkdir -p target/deploy
  66. echo ${{ secrets.WORLD }} > target/deploy/world-keypair.json
  67. echo ${{ secrets.BOLT_COMPONENT }} > target/deploy/bolt_component-keypair.json
  68. echo ${{ secrets.BOLT_SYSTEM }} > target/deploy/bolt_system-keypair.json
  69. echo ${{ secrets.COMPONENT_POSITION }} > target/deploy/component_position-keypair.json
  70. echo ${{ secrets.COMPONENT_VELOCITY }} > target/deploy/component_velocity-keypair.json
  71. echo ${{ secrets.SYSTEM_APPLY_VELOCITY }} > target/deploy/system_apply_velocity-keypair.json
  72. echo ${{ secrets.SYSTEM_FLY }} > target/deploy/system_fly-keypair.json
  73. echo ${{ secrets.SYSTEM_SIMPLE_MOVEMENT }} > target/deploy/system_simple_movement-keypair.json
  74. - name: Run Build and Tests
  75. run: |
  76. cargo install --path crates/bolt-cli --force --locked
  77. yarn install
  78. bolt build
  79. cd clients/typescript
  80. yarn install && yarn build
  81. cd ../..
  82. bolt test