53 lines
1.4 KiB
YAML
53 lines
1.4 KiB
YAML
name: Cargo Build & Test
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
build_and_test:
|
|
name: Rust project - latest
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
|
|
- name: Install Dependencies
|
|
run: |
|
|
sudo apt-get update -y
|
|
sudo apt-get upgrade -y
|
|
sudo apt-get install libssl-dev openssl -y
|
|
|
|
- name: Early Build
|
|
run: cargo build --workspace --tests
|
|
|
|
- name: Install node deps
|
|
run: yarn
|
|
|
|
- name: Setup validator
|
|
run: |
|
|
sh -c "$(curl -sSfL https://release.solana.com/v1.15.2/install)"
|
|
echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
|
|
export PATH="$HOME/.local/share/solana/install/active_release/bin:$PATH"
|
|
ls "$HOME/.local/share/solana/install/active_release/bin"
|
|
echo "Solana Cli installed"
|
|
solana --version
|
|
echo "Generating keypair..."
|
|
solana-keygen new -o "$HOME/.config/solana/id.json" --no-passphrase --silent
|
|
solana config set --url "http://0.0.0.0:8899"
|
|
|
|
- name: Run and Test
|
|
run: |
|
|
sh -c "solana-test-validator" &
|
|
sleep 20 && solana airdrop 10000
|
|
cargo run &
|
|
sleep 20 && cargo test
|
|
yarn test
|
|
pkill lite-rpc
|
|
kill $(jobs -p)
|