🔪 Minimal Working Solana Anchor CI (No Docker, No Beargrease)
This repo proves the minimal setup required to run a full Solana Anchor test suite inside GitHub Actions CI — cleanly, deterministically, and without external tooling.
- Builds an Anchor program
- Deploys to
solana-test-validatorin CI - Automatically patches
Anchor.tomlandlib.rswith the deployed program ID - Runs TypeScript ESM tests via Mocha using
ts-nodeinNodeNextmode - Passes CI with a single command:
yarn test
.
├── .github/workflows/ci.yml # GitHub Actions test pipeline
├── programs/
│ └── ci-proof-core/
│ └── src/lib.rs # Say Hello program
├── tests/
│ └── ci-proof-core.test.mts # ESM Mocha test file
├── Anchor.toml
├── package.json
├── tsconfig.json
solana-test-validator &This uses the system’s Solana CLI — no Docker needed.
solana-keygen new --no-bip39-passphrase -o ~/.config/solana/id.json
solana config set --keypair ~/.config/solana/id.json
solana airdrop 10This wallet is used to deploy and test the program.
anchor deployThis writes target/deploy/ci_proof_core-keypair.json, which contains the actual deployed program ID.
Anchor.tomlprograms/ci-proof-core/src/lib.rs
Example line patched:
ci_proof_core = "8cZtsmjcEvh6UMU6ZzBpGEmL1hjxetEsH2U9cQiHeYiE"and
declare_id!("8cZtsmjcEvh6UMU6ZzBpGEmL1hjxetEsH2U9cQiHeYiE");anchor build
anchor deployNow the .so file matches the correct ID.
yarn test --exitThis calls the say_hello instruction and verifies the program logs.
Example output:
✅ Transaction signature: ...
✔ calls say_hello (348ms)- Clone the repo:
git clone https://github.com/rgmelvin/ci-proof-core.git
cd ci-proof-core- Run locally:
solana-test-validator &
solana airdrop 10
anchor build && anchor deploy
yarn test-
Modify the program in
src/lib.rs -
Add your own test in
tests/*.test.mtsFor more details on running CI-Proof-Core, see the Beginner's Guide to ci-proof-core for full instructions on running tests, understanding structure, and modifying the program.
ci-proof-core is a transparent diagnostic harness, not a Beargrease replacement.
It was built to:
- Prove exactly what Beargrease must do under the hood
- Expose each failure point (wallets, program ID, timing, build order)
- Serve as a teaching and debugging tool
Beargrease remains the goal:
- Plug-and-play
- Portable
- Fully automated and reusable across multiple Anchor projects
We will use ci-proof-core to incrementally reintroduce Beargrease modules, verifying correctness at every step. Future Beargrease updates will refer to this scaffold for clarity and reproducibility.
This scaffold serves as the controlled environment for testing Beargrease’s new Directory Checkout Mode introduced in v1.1.0. Any new module, patch, or CI flow in Beargrease must prove itself here before upstreaming.
- Solana CLI v1.18.11
- Anchor CLI v0.31.1
- Node.js v20.18.0 (as used in GitHub Actions runner)
- Yarn v1.22.22
- TypeScript + Mocha using ESM (
.mts) andts-node
This repository is a conceptual proof—not a production-hardened implementation.
The CI pipeline and test harness here are intended to demonstrate a clean, fully working flow for:
- Building and deploying Anchor programs in CI
- Dynamically patching program IDs
- Running Mocha-based ESM tests against a local
solana-test-validator
While it uses best practices for dependency management, permission scoping, and workflow hygiene, it does not include:
- Container isolation for validator sandboxing
- Secret rotation or hardened credential management
- Runtime validation of Solana program logic or test results beyond the included assertions
- Audit-ready controls for production deployment pipelines
This project is published under the MIT License and provided as-is, without warranty. It is meant for education, experimentation, and as a foundation for building more robust systems—like the upcoming Beargrease harness, which will include:
- Pluggable security modules
- CI credential sandboxing
- Verifiable test isolation
- Portable and standardized workflows for team use
If you use this scaffold in a real-world system, please audit your changes carefully, and do not treat it as a drop-in production pipeline without further hardening.
scaffold-v0.1: clean baseline without Beargrease or Docker
Cabrillo! Labs Contact: cabrilloweb3@gmail.com
MIT – see MIT License