.travis.yml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. _examples: &examples
  13. before_install:
  14. - nvm install $NODE_VERSION
  15. - npm install -g mocha
  16. - npm install -g @project-serum/anchor
  17. - sudo apt-get install -y pkg-config build-essential libudev-dev
  18. - sh -c "$(curl -sSfL https://release.solana.com/v1.5.0/install)"
  19. - export PATH="/home/travis/.local/share/solana/install/active_release/bin:$PATH"
  20. - export NODE_PATH="/home/travis/.nvm/versions/node/v$NODE_VERSION/lib/node_modules/:$NODE_PATH"
  21. - yes | solana-keygen new
  22. - cargo install --git https://github.com/project-serum/anchor anchor-cli --locked
  23. jobs:
  24. include:
  25. - <<: *defaults
  26. name: Build and test Rust
  27. script:
  28. - cargo build
  29. - cargo fmt -- --check
  30. - cargo test
  31. - <<: *defaults
  32. name: Build and test TypeScript
  33. script:
  34. - cd ts
  35. - yarn
  36. - yarn build
  37. - <<: *examples
  38. name: Runs the examples
  39. script:
  40. - pushd examples/tutorial/basic-0 && anchor test && popd
  41. - pushd examples/tutorial/basic-1 && anchor test && popd
  42. - pushd examples/tutorial/basic-2 && anchor test && popd