Files
opencode-rails/.github/workflows/test.yml
Ajay Krishnan ab687d244d
Some checks failed
Test / test (3.4) (push) Failing after 31s
Test / test (3.3) (push) Failing after 35s
Test / test (3.2) (push) Failing after 41s
Add GitHub Actions CI workflow
Same pattern as opencode-ruby's CI. Workflow runs test suite + gem
build + post-install smoke load on Ruby 3.2 / 3.3 / 3.4.

Note: the 'Verify gem loads after install' step depends on
opencode-ruby being resolvable. Once both gems are on rubygems.org
the runtime_dependency resolves automatically; until then, contributors
who want to run the full workflow locally need to either install
opencode-ruby first or rely on the existing 'bundle exec rake test'
step (which uses the Gemfile-resolved dep, not the gem-spec-resolved
one).
2026-05-20 06:45:57 -07:00

40 lines
1.0 KiB
YAML

name: Test
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: ["3.2", "3.3", "3.4"]
steps:
- uses: actions/checkout@v4
- name: Set up Ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run tests
run: bundle exec rake test
- name: Build gem
run: gem build opencode-rails.gemspec
- name: Verify gem loads after install
# opencode-rails depends on opencode-ruby; until both gems
# are on rubygems.org, the install step here will only resolve
# if opencode-ruby has been pre-installed or is reachable.
# When the gems do publish, the runtime_dependency on
# opencode-ruby will Just Work via rubygems.
run: |
gem install --local opencode-rails-*.gem --conservative
ruby -ropencode-rails -e 'puts Opencode::RAILS_VERSION'