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).
This commit is contained in:
39
.github/workflows/test.yml
vendored
Normal file
39
.github/workflows/test.yml
vendored
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
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'
|
||||||
Reference in New Issue
Block a user