Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/.ghaignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ compression/cnft-vault/anchor
# builds but need to test on localhost
compression/cnft-burn/anchor

# CPI quasar project uses subdirectories (hand/ and lever/) instead of a root Quasar.toml
basics/cross-program-invocation/quasar


# build failed - program outdated
Expand Down
47 changes: 37 additions & 10 deletions .github/workflows/quasar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,22 +171,49 @@ jobs:
echo "Building and Testing $project with Solana $solana_version"
cd "$project" || return 1

# Build with quasar CLI
if ! quasar build; then
echo "::error::quasar build failed for $project"
echo "$project: quasar build failed with $solana_version" >> $GITHUB_WORKSPACE/failed_projects.txt
cd - > /dev/null
return 1
# Determine the quasar program directories for this project. Normally
# the project dir itself holds the Quasar.toml. Some examples (e.g. the
# cross-program-invocation CPI demo) instead contain several program
# subdirectories (hand/, lever/), each its own Quasar project. In that
# case build them all *first*, then test them all, so a program whose
# tests load a sibling program's compiled .so (the CPI callee) has it
# available regardless of directory order.
local prog_dirs=()
if [ -f Quasar.toml ]; then
prog_dirs=(".")
else
for d in */; do
[ -f "${d}Quasar.toml" ] && prog_dirs+=("${d%/}")
done
fi

# Run Rust tests (quasar examples use cargo test with quasar-svm)
if ! cargo test; then
echo "::error::cargo test failed for $project"
echo "$project: cargo test failed with $solana_version" >> $GITHUB_WORKSPACE/failed_projects.txt
if [ ${#prog_dirs[@]} -eq 0 ]; then
echo "::error::no Quasar.toml found for $project"
echo "$project: no Quasar.toml found with $solana_version" >> $GITHUB_WORKSPACE/failed_projects.txt
cd - > /dev/null
return 1
fi

# Build every program first.
for d in "${prog_dirs[@]}"; do
if ! ( cd "$d" && quasar build ); then
echo "::error::quasar build failed for $project ($d)"
echo "$project: quasar build failed with $solana_version" >> $GITHUB_WORKSPACE/failed_projects.txt
cd - > /dev/null
return 1
fi
done

# Then run Rust tests (quasar examples use cargo test with quasar-svm).
for d in "${prog_dirs[@]}"; do
if ! ( cd "$d" && cargo test ); then
echo "::error::cargo test failed for $project ($d)"
echo "$project: cargo test failed with $solana_version" >> $GITHUB_WORKSPACE/failed_projects.txt
cd - > /dev/null
return 1
fi
done

echo "Build and tests succeeded for $project with $solana_version version."
cd - > /dev/null
return 0
Expand Down
Loading