.travis.yml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. dist: bionic
  2. language: rust
  3. rust:
  4. - stable
  5. cache: cargo
  6. env:
  7. - NODE_VERSION="14.7.0"
  8. _defaults: &defaults
  9. before_install:
  10. - rustup component add rustfmt
  11. - nvm install $NODE_VERSION
  12. - sudo apt-get install -y pkg-config build-essential libudev-dev
  13. _examples: &examples
  14. before_install:
  15. - nvm install $NODE_VERSION
  16. - npm install -g mocha
  17. - npm install -g @project-serum/anchor
  18. - npm install -g @project-serum/serum
  19. - npm install -g @project-serum/common
  20. - npm install -g @solana/spl-token
  21. - sudo apt-get install -y pkg-config build-essential libudev-dev
  22. - sh -c "$(curl -sSfL https://release.solana.com/v1.5.5/install)"
  23. - export PATH="/home/travis/.local/share/solana/install/active_release/bin:$PATH"
  24. - export NODE_PATH="/home/travis/.nvm/versions/node/v$NODE_VERSION/lib/node_modules/:$NODE_PATH"
  25. - yes | solana-keygen new
  26. - cargo install --git https://github.com/project-serum/anchor anchor-cli --locked
  27. jobs:
  28. include:
  29. - <<: *defaults
  30. name: Build and test Rust
  31. script:
  32. - cargo build
  33. - cargo fmt -- --check
  34. - cargo test
  35. - <<: *defaults
  36. name: Build and test TypeScript
  37. script:
  38. - cd ts
  39. - yarn
  40. - yarn build
  41. - <<: *examples
  42. name: Runs the examples
  43. script:
  44. - pushd examples/sysvars && anchor test && popd
  45. - pushd examples/composite && anchor test && popd
  46. - pushd examples/errors && anchor test && popd
  47. - pushd examples/spl/token-proxy && anchor test && popd
  48. - pushd examples/tutorial/basic-0 && anchor test && popd
  49. - pushd examples/tutorial/basic-1 && anchor test && popd
  50. - pushd examples/tutorial/basic-2 && anchor test && popd
  51. - pushd examples/tutorial/basic-3 && anchor test && popd
  52. - pushd examples/tutorial/basic-4 && anchor test && popd