anchor/.travis.yml

54 lines
1.7 KiB
YAML
Raw Normal View History

2021-01-07 04:04:44 +08:00
dist: bionic
2021-01-07 03:52:09 +08:00
language: rust
rust:
- stable
cache: cargo
env:
- NODE_VERSION="14.7.0"
_defaults: &defaults
before_install:
- rustup component add rustfmt
- nvm install $NODE_VERSION
2021-01-07 04:04:44 +08:00
_examples: &examples
before_install:
- nvm install $NODE_VERSION
- npm install -g mocha
- npm install -g @project-serum/anchor
2021-01-16 11:16:17 +08:00
- npm install -g @project-serum/serum
- npm install -g @project-serum/common
- npm install -g @solana/spl-token
2021-01-07 04:04:44 +08:00
- sudo apt-get install -y pkg-config build-essential libudev-dev
- sh -c "$(curl -sSfL https://release.solana.com/v1.5.0/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
2021-01-10 14:03:14 +08:00
- cargo install --git https://github.com/project-serum/anchor anchor-cli --locked
2021-01-07 04:04:44 +08:00
2021-01-07 03:52:09 +08:00
jobs:
include:
- <<: *defaults
2021-01-07 04:04:44 +08:00
name: Build and test Rust
2021-01-07 03:52:09 +08:00
script:
- cargo build
- cargo fmt -- --check
- cargo test
- <<: *defaults
2021-01-07 04:04:44 +08:00
name: Build and test TypeScript
2021-01-07 03:52:09 +08:00
script:
- cd ts
- yarn
- yarn build
2021-01-07 04:04:44 +08:00
- <<: *examples
name: Runs the examples
script:
2021-01-12 01:22:25 +08:00
- pushd examples/sysvars && anchor test && popd
2021-01-15 14:35:50 +08:00
- pushd examples/composite && anchor test && popd
2021-01-21 09:13:02 +08:00
- pushd examples/errors && anchor test && popd
2021-01-16 11:16:17 +08:00
- pushd examples/spl/token-proxy && anchor test && popd
2021-01-07 04:04:44 +08:00
- pushd examples/tutorial/basic-0 && anchor test && popd
- pushd examples/tutorial/basic-1 && anchor test && popd
- pushd examples/tutorial/basic-2 && anchor test && popd
2021-01-15 07:21:51 +08:00
- pushd examples/tutorial/basic-3 && anchor test && popd