Skip to content

Commit 4792d1c

Browse files
Run examples in CI
1 parent 301d259 commit 4792d1c

File tree

5 files changed

+30
-8
lines changed

5 files changed

+30
-8
lines changed

.travis.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
dist: bionic
12
language: rust
23
rust:
34
- stable
@@ -10,17 +11,35 @@ _defaults: &defaults
1011
- rustup component add rustfmt
1112
- nvm install $NODE_VERSION
1213

14+
_examples: &examples
15+
before_install:
16+
- nvm install $NODE_VERSION
17+
- npm install -g mocha
18+
- npm install -g @project-serum/anchor
19+
- sudo apt-get install -y pkg-config build-essential libudev-dev
20+
- sh -c "$(curl -sSfL https://release.solana.com/v1.5.0/install)"
21+
- export PATH="/home/travis/.local/share/solana/install/active_release/bin:$PATH"
22+
- export NODE_PATH="/home/travis/.nvm/versions/node/v$NODE_VERSION/lib/node_modules/:$NODE_PATH"
23+
- yes | solana-keygen new
24+
- cargo install --git https://github.com/project-serum/anchor anchor-cli
25+
1326
jobs:
1427
include:
1528
- <<: *defaults
16-
name: Build and Test Rust
29+
name: Build and test Rust
1730
script:
1831
- cargo build
1932
- cargo fmt -- --check
2033
- cargo test
2134
- <<: *defaults
22-
name: Build and Test TypeScript
35+
name: Build and test TypeScript
2336
script:
2437
- cd ts
2538
- yarn
2639
- yarn build
40+
- <<: *examples
41+
name: Runs the examples
42+
script:
43+
- pushd examples/tutorial/basic-0 && anchor test && popd
44+
- pushd examples/tutorial/basic-1 && anchor test && popd
45+
- pushd examples/tutorial/basic-2 && anchor test && popd

cli/src/main.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -367,10 +367,7 @@ fn deploy_ws(url: &str, keypair: &str) -> Result<Vec<(Program, Pubkey)>> {
367367
let mut programs = vec![];
368368
println!("Deploying workspace to {}...", url);
369369
for program in read_all_programs()? {
370-
let binary_path = format!(
371-
"target/bpfel-unknown-unknown/release/{}.so",
372-
program.lib_name
373-
);
370+
let binary_path = format!("target/deploy/{}.so", program.lib_name);
374371
println!("Deploying {}...", binary_path);
375372
let exit = std::process::Command::new("solana")
376373
.arg("deploy")

docs/src/getting-started/installation.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ For now, we can use Cargo to install the CLI.
3737
cargo install --git https://github.com/project-serum/anchor anchor-cli
3838
```
3939

40+
On Linux systems you may need to install additional dependencies. On Ubuntu,
41+
42+
```bash
43+
sudo apt-get install -y pkg-config build-essential libudev-dev
44+
```
45+
4046
To install the JavaScript package.
4147

4248
```bash
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
cluster = "localnet"
2-
wallet = "/home/armaniferrante/.config/solana/id.json"
2+
wallet = "~/.config/solana/id.json"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
cluster = "localnet"
2-
wallet = "/home/armaniferrante/.config/solana/id.json"
2+
wallet = "~/.config/solana/id.json"

0 commit comments

Comments
 (0)