-
-
Notifications
You must be signed in to change notification settings - Fork 79
114 lines (108 loc) · 2.99 KB
/
ci.yml
File metadata and controls
114 lines (108 loc) · 2.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: CI
on:
pull_request:
push:
branches: [ main ]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ruby-3.3.0
bundler-cache: true
- name: Lint code for consistent style
run: bin/rubocop -f github
test:
runs-on: ubuntu-latest
env:
BUNDLE_JOBS: 4
BUNDLE_RETRY: 3
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}
CI: true
ANTHROPIC_API_KEY: ANTHROPIC_API_KEY
OPEN_AI_API_KEY: OPEN_AI_API_KEY
OPEN_ROUTER_API_KEY: OPEN_ROUTER_API_KEY
strategy:
fail-fast: false
matrix:
ruby: ["3.4"]
gemfile: [
"gemfiles/rails8.gemfile",
]
include:
- ruby: "3.4"
gemfile: "gemfiles/railsmain.gemfile"
- ruby: "3.3"
gemfile: "gemfiles/rails8.gemfile"
- ruby: "3.2"
gemfile: "gemfiles/rails7.gemfile"
steps:
- uses: actions/checkout@v6
- name: Install system deps
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y build-essential git libyaml-dev pkg-config
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Setup database
env:
RAILS_ENV: test
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
working-directory: test/dummy
run: |
bundle exec rails db:create
bundle exec rails db:migrate
- name: Run tests
env:
RAILS_ENV: test
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
run: bin/test
test-api-gems:
name: Test API Gems
runs-on: ubuntu-latest
env:
BUNDLE_JOBS: 4
BUNDLE_RETRY: 3
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}
CI: true
ANTHROPIC_API_KEY: ANTHROPIC_API_KEY
OPEN_AI_API_KEY: OPEN_AI_API_KEY
OPEN_ROUTER_API_KEY: OPEN_ROUTER_API_KEY
strategy:
fail-fast: false
matrix:
ruby: ["3.4"]
gemfile:
- "gemfiles/anthropic_1.12.gemfile"
- "gemfiles/anthropic_1.14.gemfile"
- "gemfiles/openai_0.34.gemfile"
- "gemfiles/openai_0.35.gemfile"
steps:
- uses: actions/checkout@v6
- name: Install system deps
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y build-essential git libyaml-dev pkg-config
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Setup database
env:
RAILS_ENV: test
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
working-directory: test/dummy
run: |
bundle exec rails db:create
bundle exec rails db:migrate
- name: Run tests
env:
RAILS_ENV: test
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
run: bin/test