This repository has been archived by the owner on Nov 25, 2024. It is now read-only.
Update README.md #28
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Program Test | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
workflow_dispatch: | |
env: | |
CARGO_TERM_COLOR: always | |
SOLANA_VERSION: 1.14.13 | |
RUST_TOOLCHAIN: stable | |
jobs: | |
build-and-test-program: | |
runs-on: ubuntu-latest | |
env: | |
cache_id: program-test | |
steps: | |
# Setup Deps | |
- uses: actions/checkout@v2 | |
- uses: ./.github/actions/install-linux-build-deps | |
- uses: ./.github/actions/install-solana | |
with: | |
solana_version: ${{ env.SOLANA_VERSION }} | |
- uses: ./.github/actions/install-rust | |
with: | |
toolchain: ${{ env.RUST_TOOLCHAIN }} | |
# Build program to create target folder. | |
- uses: ./.github/actions/build-program | |
# Restore Cache from previous build/test | |
- uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
./rust/target | |
key: | |
${{ env.cache_id }}-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{ | |
env.RUSTC_HASH }} | |
# Run test | |
- name: test-program | |
id: run_test | |
working-directory: ./program | |
run: | | |
cargo +${{ env.RUST_TOOLCHAIN }} test -- --nocapture --test-threads 1 | |
cargo +${{ env.RUST_TOOLCHAIN }} test-bpf --version | |
cargo +${{ env.RUST_TOOLCHAIN }} test-bpf --bpf-out-dir target/deploy/ -- --nocapture --test-threads 1 |