đź§Ş Simple GitHub Workflow For Spiker
One of the things I love about the Spiker gem is how easy it makes it to spin up a clean, isolated environment for trying out ideas. Whether I'm validating a concept, writing up a quick example for a coworker, or demonstrating technical proficiency, Spiker helps me get there faster. ⚡
And if you're spiking with the intention of sharing your spikes, one simple addition could transform your spikes from helpful to impressive: a GitHub Actions workflow.
Why bother? Well, if you're sharing your spike with others - especially in public repositories - they may not always have the time or the ability to download and run your code locally. Docker-By-Default, the standard in new Spiker spikes, tries to improve this situation but isn't going to help 100% of the people viewing your code. By adding a GitHub workflow, you’re showing that your code actually works 🟢 right out of the box. It’s like saying:
“Don’t just take my word for it… here’s the proof.” ✅
đź› A Minimal Workflow for RSpec
If you’re using RSpec with your spike (as I often do), here’s a simple GitHub Actions workflow file you can drop into .github/workflows/ruby-specs.yml
:
name: Ruby Specs
on:
push:
paths:
- '**.rb'
- 'spec/**'
- 'Gemfile'
- '.github/workflows/ruby-specs.yml'
pull_request:
paths:
- '**.rb'
- 'spec/**'
- 'Gemfile'
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3.0
bundler-cache: true
- name: Run RSpec tests
run: bundle exec rspec
đź§© Replace the last line (bundle exec rspec
) with the appropriate command for your test framework, adjust the paths as needed, yada yada.
đź§Ľ Bonus: Clean Signal, Low Maintenance
Spiker spikes are intentionally lean, so this workflow is minimal by design. It doesn’t need to lint, deploy, or build - just prove that the tests run. This keeps the feedback loop fast and the noise low. And since it's GitHub-native, it Just Works™️ for anyone browsing your code.
🧑‍💻 Encourage Confidence and Contribution
If you're sharing spikes to teach, mentor, or collaborate, a passing test badge (or a green check on a PR) is a subtle but powerful way to signal that your spike is safe to run and worth engaging with.
So next time you spin up a spike with Spiker, take 2 extra minutes and add a .github/workflows/ruby-specs.yml
. Your future self - and your collaborators - will thank you. 🙌