Skip to content

Commit

Permalink
Reduce cargo-build-test.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
mvines committed Nov 7, 2020
1 parent 99236f4 commit eafa215
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: programs
path: "*.so"
path: "target/deploy/*.so"
if-no-files-found: error

js-test-token:
Expand Down
32 changes: 16 additions & 16 deletions ci/cargo-build-test.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#!/usr/bin/env bash

set -e
cd "$(dirname "$0")"
cd ..
cd "$(dirname "$0")/.."

source ./ci/rust-version.sh stable
source ./ci/solana-version.sh install
Expand All @@ -12,26 +11,27 @@ export RUSTBACKTRACE=1

set -x

# For all BPF programs
for Xargo_toml in $(git ls-files -- '*/Xargo.toml'); do
program_dir=$(dirname "$Xargo_toml")

if [ "$program_dir" == "token-swap/program" ]; then
address="SwaPpA9LAaLfeLi3a68M4DjnLqgtticKg6CnyNwgAC8"
SWAP_PROGRAM_OWNER_FEE_ADDRESS="$address" cargo build-bpf \
--manifest-path=token-swap/program/Cargo.toml \
--dump --features production
mv target/deploy/spl_token_swap.so target/deploy/spl_token_swap_production.so
fi

cargo +"$rust_stable" test-bpf --manifest-path="$program_dir"/Cargo.toml -- --nocapture
done
# Build/test all BPF programs
cargo +"$rust_stable" test-bpf -- --nocapture

# Build/test all host crates
cargo +"$rust_stable" build
cargo +"$rust_stable" test -- --nocapture

# Run test-client sanity check
cargo +"$rust_stable" run --manifest-path=utils/test-client/Cargo.toml

# client_ristretto isn't in the workspace, test it explictly
cargo +"$rust_stable" test --manifest-path=themis/client_ristretto/Cargo.toml -- --nocapture


SWAP_PROGRAM_OWNER_FEE_ADDRESS="SwaPpA9LAaLfeLi3a68M4DjnLqgtticKg6CnyNwgAC8" \
cargo +"$rust_stable" build-bpf \
--manifest-path=token-swap/program/Cargo.toml \
--features production \
--bpf-out-dir target/deploy-production
mv target/deploy-production/spl_token_swap.so target/deploy/spl_token_swap_production.so

# # Check generated C headers
# cargo run --manifest-path=utils/cgen/Cargo.toml
#
Expand Down

0 comments on commit eafa215

Please sign in to comment.