.travis.yml 2.4 KB

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