Update smoke tests to use both Rack 2 and 3 #138
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: tests | |
on: | |
push: | |
jobs: | |
rubocop: | |
runs-on: ubuntu-latest | |
env: | |
BUNDLE_RUBYGEMS__PKG__GITHUB__COM: gocardless-robot-readonly:${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
ruby-version: "3.0" | |
- name: Run rubocop | |
run: | | |
bundle exec rubocop --extra-details --display-style-guide --no-server --parallel | |
smoke_test: | |
strategy: | |
fail-fast: false | |
matrix: | |
ruby_version: ["3.0", "3.1", "3.2", "3.3"] | |
rack_version: ["~> 2", "~> 3"] | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:14.2 | |
env: | |
POSTGRES_DB: que-test | |
POSTGRES_USER: ubuntu | |
POSTGRES_PASSWORD: password | |
ports: | |
- 5432:5432 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 10 | |
env: | |
PGDATABASE: que-test | |
PGUSER: ubuntu | |
PGPASSWORD: password | |
PGHOST: localhost | |
BUNDLE_RUBYGEMS__PKG__GITHUB__COM: gocardless-robot-readonly:${{ secrets.GITHUB_TOKEN }} | |
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 | |
rspec: | |
strategy: | |
fail-fast: false | |
matrix: | |
ruby_version: ["3.0", "3.1", "3.2", "3.3"] | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:14.2 | |
env: | |
POSTGRES_DB: que-test | |
POSTGRES_USER: ubuntu | |
POSTGRES_PASSWORD: password | |
ports: | |
- 5432:5432 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 10 | |
env: | |
PGDATABASE: que-test | |
PGUSER: ubuntu | |
PGPASSWORD: password | |
PGHOST: localhost | |
BUNDLE_RUBYGEMS__PKG__GITHUB__COM: gocardless-robot-readonly:${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
ruby-version: "${{ matrix.ruby-version }}" | |
- name: Run specs | |
run: | | |
bundle exec rspec | |
active_record_with_lock_adapter_rspec: | |
strategy: | |
fail-fast: false | |
matrix: | |
ruby_version: ["3.0", "3.1", "3.2", "3.3"] | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:14.2 | |
env: | |
POSTGRES_DB: que-test | |
POSTGRES_USER: ubuntu | |
POSTGRES_PASSWORD: password | |
ports: | |
- 5432:5432 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 10 | |
lock_database: | |
image: postgres:14.2 | |
env: | |
POSTGRES_DB: lock-test | |
POSTGRES_USER: ubuntu | |
POSTGRES_PASSWORD: password | |
ports: | |
- 5434:5432 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 10 | |
env: | |
PGDATABASE: que-test | |
PGUSER: ubuntu | |
PGPASSWORD: password | |
PGHOST: localhost | |
BUNDLE_RUBYGEMS__PKG__GITHUB__COM: gocardless-robot-readonly:${{ secrets.GITHUB_TOKEN }} | |
LOCK_PGDATABASE: lock-test | |
LOCK_PGUSER: ubuntu | |
LOCK_PGPASSWORD: password | |
LOCK_PGHOST: localhost | |
ADAPTER: ActiveRecordWithLock | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
ruby-version: "${{ matrix.ruby-version }}" | |
- name: Run Specs With ActiveRecordWithLock Adapter | |
run: bundle exec rspec | |