run-tests.yml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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: Install Rust
  25. uses: dtolnay/rust-toolchain@stable
  26. with:
  27. toolchain: stable
  28. - name: Install Solana
  29. run: |
  30. sh -c "$(curl -sSfL https://release.solana.com/${{ env.solana_version }}/install)"
  31. export PATH="$HOME/.local/share/solana/install/active_release/bin:$PATH"
  32. echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
  33. solana --version
  34. lint:
  35. needs: setup
  36. runs-on: ubuntu-latest
  37. strategy:
  38. matrix:
  39. task: [clippy, yarn]
  40. steps:
  41. - uses: actions/checkout@v4
  42. - name: Install node modules
  43. run: |
  44. yarn --frozen-lockfile --network-concurrency 2
  45. - name: Run Lint
  46. run: |
  47. if [ "${{ matrix.task }}" == "clippy" ]; then
  48. cargo fmt -- --check --verbose
  49. cargo clippy -- --deny=warnings
  50. else
  51. yarn lint
  52. fi
  53. test:
  54. needs: lint
  55. runs-on: ubuntu-latest
  56. steps:
  57. - uses: actions/checkout@v4
  58. - name: Install Rust
  59. uses: dtolnay/rust-toolchain@stable
  60. with:
  61. toolchain: stable
  62. - name: Install Solana
  63. run: |
  64. sh -c "$(curl -sSfL https://release.solana.com/${{ env.solana_version }}/install)"
  65. export PATH="$HOME/.local/share/solana/install/active_release/bin:$PATH"
  66. echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
  67. solana --version
  68. - name: Create keypair
  69. run: |
  70. export PATH="$HOME/.local/share/solana/install/active_release/bin:$PATH"
  71. solana --version
  72. solana-keygen new --silent --no-bip39-passphrase
  73. - name: Set Deployment Keys
  74. run: |
  75. mkdir -p target/deploy
  76. echo ${{ secrets.WORLD }} > target/deploy/world-keypair.json
  77. echo ${{ secrets.BOLT_COMPONENT }} > target/deploy/bolt_component-keypair.json
  78. echo ${{ secrets.BOLT_SYSTEM }} > target/deploy/bolt_system-keypair.json
  79. echo ${{ secrets.COMPONENT_POSITION }} > target/deploy/component_position-keypair.json
  80. echo ${{ secrets.COMPONENT_VELOCITY }} > target/deploy/component_velocity-keypair.json
  81. echo ${{ secrets.SYSTEM_APPLY_VELOCITY }} > target/deploy/system_apply_velocity-keypair.json
  82. echo ${{ secrets.SYSTEM_FLY }} > target/deploy/system_fly-keypair.json
  83. echo ${{ secrets.SYSTEM_SIMPLE_MOVEMENT }} > target/deploy/system_simple_movement-keypair.json
  84. - name: Run Build and Tests
  85. run: |
  86. cargo install --path cli --force --locked
  87. yarn install
  88. bolt build
  89. cd clients/bolt-sdk
  90. yarn install && yarn build
  91. cd ../..
  92. bolt test