.travis.yml 3.1 KB

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