Skip to content

Commit

Permalink
Make installations less hacky
Browse files Browse the repository at this point in the history
  • Loading branch information
tschafer-gc committed Nov 14, 2024
1 parent 5fcf274 commit 5120219
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
11 changes: 2 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
fail-fast: false
matrix:
ruby_version: ["3.0", "3.1", "3.2", "3.3"]
rack_version: ["~> 2", "~> 3"]
rack_version: ["2.2", "3.1"]
runs-on: ubuntu-latest
services:
postgres:
Expand All @@ -46,21 +46,14 @@ jobs:
PGPASSWORD: password
PGHOST: localhost
BUNDLE_RUBYGEMS__PKG__GITHUB__COM: gocardless-robot-readonly:${{ secrets.GITHUB_TOKEN }}
RACK_VERSION: "${{ matrix.rack_version }}"
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: "${{ matrix.ruby_version }}"
- name: Update Gemfile for Rack and Rackup versions
run: |
if [[ "${{ matrix.rack_version }}" == "~> 2" ]]; then
echo 'gem "rackup", "~> 1"' >> Gemfile
fi
echo 'gem "rack", "${{ matrix.rack_version }}"' >> Gemfile
- name: Install Dependencies
run: bundle install
- name: Start bin/que
run: |
bundle exec bin/que ./lib/que.rb --metrics-port=8080 --ci
Expand Down
8 changes: 8 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ group :test do
gem 'rspec', '~> 3.9'
end

rack_version = ENV['RACK_VERSION'] || "3.0"
gem "rack", rack_version
if Gem::Version.new(rack_version) < Gem::Version.new('3.0.0')
gem "rackup", "~> 1.0"
else
gem "rackup", "~> 2.0"
end

gem 'prometheus-client', '~> 1.0'
source "https://rubygems.pkg.github.com/gocardless" do
gem "prometheus_gcstat"
Expand Down

0 comments on commit 5120219

Please sign in to comment.