run-tests.yml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. echo "/home/runner/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
  39. solana --version
  40. lint:
  41. needs: setup
  42. runs-on: ubuntu-latest
  43. strategy:
  44. matrix:
  45. task: [clippy, yarn]
  46. steps:
  47. - uses: actions/checkout@v4
  48. - name: Install node modules
  49. run: |
  50. yarn --frozen-lockfile --network-concurrency 2
  51. - name: Cache Rust
  52. uses: Swatinem/rust-cache@v2
  53. - name: Run Lint
  54. run: |
  55. if [ "${{ matrix.task }}" == "clippy" ]; then
  56. cargo fmt -- --check --verbose
  57. cargo clippy -- --deny=warnings
  58. else
  59. yarn lint
  60. fi
  61. test:
  62. needs: lint
  63. runs-on: ubuntu-latest
  64. steps:
  65. - uses: actions/checkout@v4
  66. - name: Create keypair
  67. run: |
  68. solana --version
  69. solana-keygen new --silent --no-bip39-passphrase
  70. solana airdrop 100
  71. - name: Set Deployment Keys
  72. run: |
  73. mkdir -p target/deploy
  74. echo ${{ secrets.WORLD }} > target/deploy/world-keypair.json
  75. echo ${{ secrets.BOLT_COMPONENT }} > target/deploy/bolt_component-keypair.json
  76. echo ${{ secrets.BOLT_SYSTEM }} > target/deploy/bolt_system-keypair.json
  77. echo ${{ secrets.COMPONENT_POSITION }} > target/deploy/component_position-keypair.json
  78. echo ${{ secrets.COMPONENT_VELOCITY }} > target/deploy/component_velocity-keypair.json
  79. echo ${{ secrets.SYSTEM_APPLY_VELOCITY }} > target/deploy/system_apply_velocity-keypair.json
  80. echo ${{ secrets.SYSTEM_FLY }} > target/deploy/system_fly-keypair.json
  81. echo ${{ secrets.SYSTEM_SIMPLE_MOVEMENT }} > target/deploy/system_simple_movement-keypair.json
  82. - name: Run Build and Tests
  83. run: |
  84. cargo install --path cli --force --locked
  85. bolt build
  86. cd clients/bolt-sdk
  87. yarn install && yarn build
  88. cd ../..
  89. bolt test