Skip to content

Commit 388636d

Browse files
authored
Add API gem version testing and fix Anthropic 1.14.0 compatibility (#265)
1 parent d818575 commit 388636d

7 files changed

Lines changed: 84 additions & 506 deletions

File tree

.github/workflows/ci.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,49 @@ jobs:
7070
RAILS_ENV: test
7171
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
7272
run: bin/test
73+
74+
test-api-gems:
75+
name: Test API Gems
76+
runs-on: ubuntu-latest
77+
env:
78+
BUNDLE_JOBS: 4
79+
BUNDLE_RETRY: 3
80+
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
81+
CI: true
82+
ANTHROPIC_API_KEY: ANTHROPIC_API_KEY
83+
OPEN_AI_API_KEY: OPEN_AI_API_KEY
84+
OPEN_ROUTER_API_KEY: OPEN_ROUTER_API_KEY
85+
strategy:
86+
fail-fast: false
87+
matrix:
88+
ruby: ["3.4"]
89+
gemfile:
90+
- "gemfiles/anthropic_1.12.gemfile"
91+
- "gemfiles/anthropic_1.14.gemfile"
92+
- "gemfiles/openai_0.34.gemfile"
93+
- "gemfiles/openai_0.35.gemfile"
94+
steps:
95+
- uses: actions/checkout@v5
96+
- name: Install system deps
97+
run: |
98+
sudo apt-get update
99+
sudo apt-get install --no-install-recommends -y build-essential git libyaml-dev pkg-config
100+
- uses: ruby/setup-ruby@v1
101+
with:
102+
ruby-version: ${{ matrix.ruby }}
103+
bundler-cache: true
104+
- name: Setup database
105+
env:
106+
RAILS_ENV: test
107+
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
108+
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}
109+
run: |
110+
cd test/dummy
111+
bundle exec rails db:create
112+
bundle exec rails db:migrate
113+
cd ../..
114+
- name: Run tests
115+
env:
116+
RAILS_ENV: test
117+
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
118+
run: bin/test

gemfiles/anthropic_1.12.gemfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
source "https://rubygems.org"
2+
3+
gem "anthropic", "~> 1.12.0"
4+
5+
gemspec path: ".."

gemfiles/anthropic_1.14.gemfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
source "https://rubygems.org"
2+
3+
gem "anthropic", "~> 1.14.0"
4+
5+
gemspec path: ".."

gemfiles/openai_0.34.gemfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# frozen_string_literal: true
2+
3+
source "https://rubygems.org"
4+
5+
gem "openai", "~> 0.34.0"
6+
7+
gemspec path: ".."

gemfiles/openai_0.35.gemfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# frozen_string_literal: true
2+
3+
source "https://rubygems.org"
4+
5+
gem "openai", "~> 0.35.0"
6+
7+
gemspec path: ".."

0 commit comments

Comments
 (0)