Gate alpha8 release on full Ruby matrix

This commit is contained in:
2026-07-20 15:34:33 -07:00
parent 49a161632e
commit f4bf4eb625
5 changed files with 50 additions and 2 deletions

View File

@@ -6,7 +6,34 @@ on:
- "v*"
jobs:
verify:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: ["3.2", "3.3", "3.4", "4.0"]
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Set up Ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@003a5c4d8d6321bd302e38f6f0ec593f77f06600 # v1.319.0
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run tests
run: bundle exec rake test
- name: Build gem
run: gem build opencode-ruby.gemspec
- name: Verify gem loads after install
run: |
gem install opencode-ruby-*.gem --no-document
ruby -ropencode-ruby -e 'puts Opencode::VERSION'
push:
needs: verify
if: ${{ github.server_url == 'https://github.com' }}
runs-on: ubuntu-latest
permissions:

View File

@@ -202,7 +202,8 @@ Want every OpenCode endpoint auto-generated from the OpenAPI spec? Use [`opencod
## Compatibility
- Ruby ≥ 3.2
- Runtime dependency: `activesupport (>= 6.1)`*not* Rails. ActiveSupport is a standalone helpers gem (`blank?`, `present?`, `presence`, `truncate`, etc.).
- Runtime dependency: `activesupport (>= 6.1, < 9.0)`*not* Rails. ActiveSupport is a standalone helpers gem (`blank?`, `present?`, `presence`, `truncate`, etc.).
- Runtime dependency: `marcel (~> 1.0)` for artifact MIME type detection.
OpenCode server compatibility is evidence-based, not an open-ended SemVer
promise. OpenCode's HTTP, SSE, and runtime behavior can change independently

View File

@@ -16,4 +16,9 @@ class ReadmeContractTest < Minitest::Test
assert_includes README, "not configured as of `0.0.1.alpha7`"
assert_includes README, "does not currently guarantee publication"
end
def test_compatibility_documents_every_runtime_dependency
assert_includes README, "`activesupport (>= 6.1, < 9.0)`"
assert_includes README, "`marcel (~> 1.0)`"
end
end

View File

@@ -17,6 +17,10 @@ class ReleaseWorkflowTest < Minitest::Test
workflow.fetch("jobs").fetch("push")
end
def verify_job
workflow.fetch("jobs").fetch("verify")
end
def test_release_job_is_inert_on_non_github_runners
assert_equal "${{ github.server_url == 'https://github.com' }}", push_job.fetch("if")
end
@@ -61,4 +65,15 @@ class ReleaseWorkflowTest < Minitest::Test
assert_operator test_index, :<, publish_index
assert_equal "bundle exec rake test", steps.fetch(test_index).fetch("run")
end
def test_release_verifies_the_supported_matrix_and_installed_gem_before_publish
assert_equal %w[3.2 3.3 3.4 4.0], verify_job.dig("strategy", "matrix", "ruby")
assert_equal "verify", push_job.fetch("needs")
commands = verify_job.fetch("steps").filter_map { |step| step["run"] }.join("\n")
assert_includes commands, "bundle exec rake test"
assert_includes commands, "gem build opencode-ruby.gemspec"
assert_includes commands, "gem install opencode-ruby-*.gem --no-document"
assert_includes commands, "ruby -ropencode-ruby"
end
end

View File

@@ -27,7 +27,7 @@ class WorkflowContractTest < Minitest::Test
workflow_uses(workflow)
end
assert_equal 5, action_uses.length
assert_equal 7, action_uses.length
action_uses.each do |action_use|
action, separator, revision = action_use.rpartition("@")