.travis.yml 3.1 KB

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