.travis.yml 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. dist: bionic
  2. language: rust
  3. rust:
  4. - stable
  5. cache: cargo
  6. env:
  7. global:
  8. - NODE_VERSION="17.0.1"
  9. - SOLANA_CLI_VERSION="1.8.0"
  10. - NODE_VERSION="17.0.1"
  11. - SOLANA_CLI_VERSION="1.7.11"
  12. git:
  13. submodules: true
  14. _defaults: &defaults
  15. before_install:
  16. - rustup component add rustfmt clippy
  17. - nvm install $NODE_VERSION
  18. - sudo apt-get install -y pkg-config build-essential libudev-dev
  19. _tests: &tests
  20. before_install:
  21. - nvm install $NODE_VERSION
  22. - npm install -g mocha
  23. - npm install -g ts-mocha
  24. - npm install -g typescript
  25. - npm install -g ts-node
  26. - npm install -g buffer
  27. - cd ts && yarn && yarn build && npm link && cd ../
  28. - npm install -g @project-serum/serum
  29. - npm install -g @project-serum/common
  30. - npm install -g @solana/spl-token
  31. - sudo apt-get install -y pkg-config build-essential libudev-dev
  32. - sh -c "$(curl -sSfL https://release.solana.com/v${SOLANA_CLI_VERSION}/install)"
  33. - export PATH="/home/travis/.local/share/solana/install/active_release/bin:$PATH"
  34. - export NODE_PATH="/home/travis/.nvm/versions/node/v${NODE_VERSION}/lib/node_modules/:$NODE_PATH"
  35. - yes | solana-keygen new
  36. - cargo install --path $TRAVIS_BUILD_DIR/cli anchor-cli --locked
  37. jobs:
  38. include:
  39. - <<: *defaults
  40. name: Build and test Rust
  41. script:
  42. - cargo build
  43. - cargo fmt -- --check
  44. - cargo clippy --all-targets -- -D warnings
  45. - cargo test
  46. - pushd ts && yarn && popd
  47. - pushd ts && yarn test && popd
  48. - pushd ts && yarn lint && popd
  49. - <<: *tests
  50. name: Runs the e2e tests 1
  51. script:
  52. - pushd client/example && ./run-test.sh && popd
  53. - pushd tests/sysvars && anchor test && popd
  54. - pushd tests/composite && anchor test && popd
  55. - pushd tests/errors && anchor test && popd
  56. - pushd tests/spl/token-proxy && anchor test && popd
  57. - pushd tests/multisig && anchor test && popd
  58. - pushd tests/interface && anchor test && popd
  59. - pushd tests/lockup && anchor test && popd
  60. - pushd tests/permissioned-markets/deps/serum-dex/dex && cargo build-bpf && cd ../../../ && anchor test && popd
  61. - <<: *tests
  62. name: Runs the e2e tests 2
  63. script:
  64. - pushd tests/misc && anchor test && popd
  65. - pushd tests/events && anchor test && popd
  66. - pushd tests/cashiers-check && anchor test && popd
  67. - pushd tests/typescript && yarn && anchor test && popd
  68. - pushd tests/zero-copy && yarn && anchor test && popd
  69. - pushd tests/chat && yarn && anchor test && popd
  70. - pushd tests/ido-pool && yarn && anchor test && popd
  71. - pushd tests/swap/deps/serum-dex/dex && cargo build-bpf && cd ../../../ && anchor test && popd
  72. - pushd tests/cfo && anchor run test-with-build && popd
  73. - <<: *tests
  74. name: Runs the e2e tests 3
  75. script:
  76. - pushd tests/escrow && yarn && anchor test && popd
  77. - pushd tests/pyth && yarn && anchor test && popd
  78. - pushd examples/tutorial/basic-0 && anchor test && popd
  79. - pushd examples/tutorial/basic-1 && anchor test && popd
  80. - pushd examples/tutorial/basic-2 && anchor test && popd
  81. - pushd examples/tutorial/basic-3 && anchor test && popd
  82. - pushd examples/tutorial/basic-4 && anchor test && popd