87 lines
3.4 KiB
YAML
87 lines
3.4 KiB
YAML
dist: bionic
|
|
language: rust
|
|
rust:
|
|
- stable
|
|
cache: cargo
|
|
env:
|
|
global:
|
|
- NODE_VERSION="14.7.0"
|
|
- SOLANA_CLI_VERSION="1.7.11"
|
|
git:
|
|
submodules: true
|
|
|
|
_defaults: &defaults
|
|
before_install:
|
|
- rustup component add rustfmt clippy
|
|
- nvm install $NODE_VERSION
|
|
- sudo apt-get install -y pkg-config build-essential libudev-dev
|
|
|
|
_tests: &tests
|
|
before_install:
|
|
- nvm install $NODE_VERSION
|
|
- npm install -g mocha
|
|
- npm install -g ts-mocha
|
|
- npm install -g typescript
|
|
- npm install -g ts-node
|
|
- npm install -g buffer
|
|
- cd ts && yarn && yarn build && npm link && cd ../
|
|
- 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/v${SOLANA_CLI_VERSION}/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 --path $TRAVIS_BUILD_DIR/cli anchor-cli --locked
|
|
|
|
jobs:
|
|
include:
|
|
- <<: *defaults
|
|
name: Build and test Rust
|
|
script:
|
|
- cargo build
|
|
- cargo fmt -- --check
|
|
- cargo clippy --all-targets -- -D warnings
|
|
- cargo test
|
|
- pushd ts && yarn && popd
|
|
- pushd ts && yarn test && popd
|
|
- pushd ts && yarn lint && popd
|
|
- <<: *tests
|
|
name: Runs the e2e tests 1
|
|
script:
|
|
- pushd client/example && ./run-test.sh && popd
|
|
- pushd tests/sysvars && anchor test && popd
|
|
- pushd tests/composite && anchor test && popd
|
|
- pushd tests/errors && anchor test && popd
|
|
- pushd tests/spl/token-proxy && anchor test && popd
|
|
- pushd tests/multisig && anchor test && popd
|
|
- pushd tests/interface && anchor test && popd
|
|
- pushd tests/lockup && anchor test && popd
|
|
- pushd tests/permissioned-markets/deps/serum-dex/dex && cargo build-bpf && cd ../../../ && anchor test && popd
|
|
- <<: *tests
|
|
name: Runs the e2e tests 2
|
|
script:
|
|
- pushd tests/misc && anchor test && popd
|
|
- pushd tests/events && anchor test && popd
|
|
- pushd tests/cashiers-check && anchor test && popd
|
|
- pushd tests/typescript && yarn && anchor test && popd
|
|
- pushd tests/zero-copy && yarn && anchor test && popd
|
|
- pushd tests/chat && yarn && anchor test && popd
|
|
- pushd tests/ido-pool && yarn && anchor test && popd
|
|
- pushd tests/swap/deps/serum-dex/dex && cargo build-bpf && cd ../../../ && anchor test && popd
|
|
- pushd tests/cfo && anchor run test-with-build && popd
|
|
- <<: *tests
|
|
name: Runs the e2e tests 3
|
|
script:
|
|
- pushd ts && yarn && yarn build && npm link && popd
|
|
- pushd examples/escrow && npm link @project-serum/anchor && yarn && popd
|
|
- pushd examples/escrow && anchor build && npx ts-node createIDLType.ts && anchor test --skip-build && popd
|
|
- pushd tests/escrow && yarn && anchor test && popd
|
|
- pushd tests/pyth && yarn && anchor test && popd
|
|
- 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
|