.travis.yml 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. dist: bionic
  2. language: rust
  3. rust:
  4. - stable
  5. cache: cargo
  6. env:
  7. global:
  8. - NODE_VERSION="14.7.0"
  9. - SOLANA_CLI_VERSION="1.7.11"
  10. git:
  11. submodules: true
  12. _defaults: &defaults
  13. before_install:
  14. - rustup component add rustfmt clippy
  15. - nvm install $NODE_VERSION
  16. - sudo apt-get install -y pkg-config build-essential libudev-dev
  17. _tests: &tests
  18. before_install:
  19. - nvm install $NODE_VERSION
  20. - npm install -g mocha
  21. - npm install -g ts-mocha
  22. - npm install -g typescript
  23. - npm install -g ts-node
  24. - npm install -g buffer
  25. - cd ts && yarn && yarn build && npm link && cd ../
  26. - npm install -g @project-serum/serum
  27. - npm install -g @project-serum/common
  28. - npm install -g @solana/spl-token
  29. - sudo apt-get install -y pkg-config build-essential libudev-dev
  30. - sh -c "$(curl -sSfL https://release.solana.com/v${SOLANA_CLI_VERSION}/install)"
  31. - export PATH="/home/travis/.local/share/solana/install/active_release/bin:$PATH"
  32. - export NODE_PATH="/home/travis/.nvm/versions/node/v${NODE_VERSION}/lib/node_modules/:$NODE_PATH"
  33. - yes | solana-keygen new
  34. - cargo install --path $TRAVIS_BUILD_DIR/cli anchor-cli --locked
  35. jobs:
  36. include:
  37. - <<: *defaults
  38. name: Build and test Rust
  39. script:
  40. - cargo build
  41. - cargo fmt -- --check
  42. - cargo clippy --all-targets -- -D warnings
  43. - cargo test
  44. - pushd ts && yarn && popd
  45. - pushd ts && yarn test && popd
  46. - pushd ts && yarn lint && popd
  47. - <<: *tests
  48. name: Runs the e2e tests 1
  49. script:
  50. - pushd client/example && ./run-test.sh && popd
  51. - pushd tests/sysvars && anchor test && popd
  52. - pushd tests/composite && anchor test && popd
  53. - pushd tests/errors && anchor test && popd
  54. - pushd tests/spl/token-proxy && anchor test && popd
  55. - pushd tests/multisig && anchor test && popd
  56. - pushd tests/interface && anchor test && popd
  57. - pushd tests/lockup && anchor test && popd
  58. - pushd tests/permissioned-markets/deps/serum-dex/dex && cargo build-bpf && cd ../../../ && anchor test && popd
  59. - <<: *tests
  60. name: Runs the e2e tests 2
  61. script:
  62. - pushd tests/misc && anchor test && popd
  63. - pushd tests/events && anchor test && popd
  64. - pushd tests/cashiers-check && anchor test && popd
  65. - pushd tests/typescript && yarn && anchor test && popd
  66. - pushd tests/zero-copy && yarn && anchor test && popd
  67. - pushd tests/chat && yarn && anchor test && popd
  68. - pushd tests/ido-pool && yarn && anchor test && popd
  69. - pushd tests/swap/deps/serum-dex/dex && cargo build-bpf && cd ../../../ && anchor test && popd
  70. - pushd tests/cfo && anchor run test-with-build && popd
  71. - <<: *tests
  72. name: Runs the e2e tests 3
  73. script:
  74. - pushd ts && yarn && yarn build && npm link && popd
  75. - pushd examples/escrow && npm link @project-serum/anchor && yarn && popd
  76. - pushd examples/escrow && anchor build && npx ts-node createIDLType.ts && anchor test --skip-build && popd
  77. - pushd tests/escrow && yarn && anchor test && popd
  78. - pushd tests/pyth && yarn && anchor test && popd
  79. - pushd examples/tutorial/basic-0 && anchor test && popd
  80. - pushd examples/tutorial/basic-1 && anchor test && popd
  81. - pushd examples/tutorial/basic-2 && anchor test && popd
  82. - pushd examples/tutorial/basic-3 && anchor test && popd
  83. - pushd examples/tutorial/basic-4 && anchor test && popd