Template showing GitHub Actions integration with MorphVM for automated testing and remote debugging. Uses a C program with a deliberate memory error to demonstrate crash capture and debug capabilities.
- Fork this repository
- Add your Morph Cloud API key as
MORPH_API_KEY
in repository secrets (Settings > Secrets and variables > Actions)
text_analyzer.c
: Word frequency counter with an intentional memory bugtest_input.py
: Test data generator.github/workflows/build_and_test.yml
: GitHub Actions workflowMakefile
: Build configuration
On push to main, GitHub Actions:
- Starts a MorphVM instance
- Builds and tests the program under GDB
- Creates a snapshot if crash occurs
To connect to a crash debug session:
morphcloud instance ssh --rm $(morphcloud instance start SNAPSHOT_ID) -- tmux attach
# Build and run
make
./text_analyzer "sample text"
# Run with test data
python3 test_input.py | ./text_analyzer
# Debug
make debug
Apache License 2.0