dist: bionic language: rust rust: - nightly cache: directories: - $HOME/.cargo - $TRAVIS_BUILD_DIR/target - $TRAVIS_BUILD_DIR/client/example/target - $TRAVIS_BUILD_DIR/examples/sysvars/target - $TRAVIS_BUILD_DIR/examples/composite/target - $TRAVIS_BUILD_DIR/examples/errors/target - $TRAVIS_BUILD_DIR/examples/spl/token-proxy/target - $TRAVIS_BUILD_DIR/examples/multisig/target - $TRAVIS_BUILD_DIR/examples/interface/target - $TRAVIS_BUILD_DIR/examples/lockup/target - $TRAVIS_BUILD_DIR/examples/misc/target - $TRAVIS_BUILD_DIR/examples/cashiers-check/target - $TRAVIS_BUILD_DIR/examples/tutorial/basic-0/target - $TRAVIS_BUILD_DIR/examples/tutorial/basic-1/target - $TRAVIS_BUILD_DIR/examples/tutorial/basic-2/target - $TRAVIS_BUILD_DIR/examples/tutorial/basic-3/target - $TRAVIS_BUILD_DIR/examples/tutorial/basic-4/target env: - NODE_VERSION="14.7.0" _defaults: &defaults before_install: - rustup component add rustfmt - nvm install $NODE_VERSION - sudo apt-get install -y pkg-config build-essential libudev-dev _examples: &examples before_install: - nvm install $NODE_VERSION - npm install -g mocha - npm install -g ts-mocha - npm install -g typescript - npm install -g @project-serum/anchor - npm install -g @project-serum/serum - npm install -g @project-serum/common - npm install -g @solana/spl-token - sudo apt-get install -y pkg-config build-essential libudev-dev - sh -c "$(curl -sSfL https://release.solana.com/v1.5.5/install)" - export PATH="/home/travis/.local/share/solana/install/active_release/bin:$PATH" - export NODE_PATH="/home/travis/.nvm/versions/node/v$NODE_VERSION/lib/node_modules/:$NODE_PATH" - yes | solana-keygen new - cargo install --git https://github.com/project-serum/anchor anchor-cli --locked jobs: include: - <<: *defaults name: Build and test Rust script: - cargo build - cargo fmt -- --check - cargo test - <<: *defaults name: Build and test TypeScript script: - cd ts - yarn - yarn build - <<: *examples name: Runs the examples 1 script: - pushd client/example && ./run-test.sh && popd - pushd examples/sysvars && anchor test && popd - pushd examples/composite && anchor test && popd - pushd examples/errors && anchor test && popd - pushd examples/spl/token-proxy && anchor test && popd - pushd examples/multisig && anchor test && popd - pushd examples/interface && anchor test && popd - pushd examples/lockup && anchor test && popd - pushd examples/misc && anchor test && popd - pushd examples/cashiers-check && anchor test && popd - <<: *examples name: Runs the examples 2 script: - pushd examples/tutorial/basic-0 && anchor test && popd - pushd examples/tutorial/basic-1 && anchor test && popd - pushd examples/tutorial/basic-2 && anchor test && popd - pushd examples/tutorial/basic-3 && anchor test && popd - pushd examples/tutorial/basic-4 && anchor test && popd