.travis.yml 2.6 KB

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