Merge pull request #241 from moneta-rb/transformer-overhaul #273
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: Ruby CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
adapters: | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
ruby-version: ['3.2', '3.1', '3.0', '2.7', '2.5', jruby] | |
adapter: | |
- Client | |
- Cookie | |
- Daybreak | |
#- dbm | |
- File | |
- Fog | |
- GDBM | |
- HashFile | |
#- HBase | |
- KyotoCabinet | |
- LevelDB | |
- LMDB | |
- LocalMemCache | |
- LRUHash | |
- Memory | |
- 'Null' | |
- PStore | |
- RestClient | |
#- riak | |
- SDBM | |
- TDB | |
- TokyoCabinet | |
- TokyoTyrant | |
- YAML | |
env: | |
BUNDLE_WITH: ${{ matrix.adapter }} snappy | |
steps: | |
- uses: actions/checkout@main | |
- name: Apt update | |
run: sudo apt-get update | |
- name: Apt install dependencies | |
run: sudo apt-get install -y libkyotocabinet-dev libleveldb-dev libtdb-dev libtokyocabinet-dev tokyotyrant libgdbm-dev | |
- name: Set up Ruby ${{ matrix.ruby-version }} | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby-version }} | |
bundler: latest | |
bundler-cache: true | |
- name: Rspec | |
run: bundle exec rspec -t ~unstable -t adapter:${{ matrix.adapter }} -- spec/moneta | |
couch: | |
name: "Couch adapter" | |
runs-on: ubuntu-latest | |
services: | |
couch: | |
image: couchdb | |
env: | |
COUCHDB_USER: admin | |
COUCHDB_PASSWORD: password | |
options: >- | |
--health-cmd "curl -s http://127.0.0.1:5984/" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5984:5984 | |
strategy: | |
matrix: | |
ruby-version: ['3.2', '3.1', '3.0', '2.7', '2.5', jruby] | |
env: | |
BUNDLE_WITH: RestClient | |
steps: | |
- uses: actions/checkout@main | |
- name: Set up Ruby ${{ matrix.ruby-version }} | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby-version }} | |
bundler: latest | |
bundler-cache: true | |
- name: Rspec | |
run: bundle exec rspec -t adapter:Couch -- spec/moneta | |
cassandra: | |
name: "Cassandra adapter" | |
runs-on: ubuntu-latest | |
services: | |
cassandra: | |
image: cassandra | |
options: >- | |
--health-cmd "cqlsh -e \"SELECT cql_version FROM system.local\"" | |
--health-interval 10s | |
--health-timeout 10s | |
--health-retries 10 | |
ports: | |
- 9042:9042 | |
strategy: | |
matrix: | |
ruby-version: ['2.7', '2.5', jruby] | |
env: | |
BUNDLE_WITH: Cassandra | |
steps: | |
- uses: actions/checkout@main | |
- name: Set up Ruby ${{ matrix.ruby-version }} | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby-version }} | |
bundler: latest | |
bundler-cache: true | |
- name: Rspec | |
run: bundle exec rspec -t adapter:Cassandra -- spec/moneta | |
mysql-adapters: | |
name: "MySQL adapters" | |
runs-on: ubuntu-latest | |
services: | |
mysql: | |
image: mysql | |
env: | |
MYSQL_ROOT_PASSWORD: moneta | |
options: >- | |
--health-cmd "mysqladmin ping -h 127.0.0.1 --silent" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 3306:3306 | |
strategy: | |
matrix: | |
ruby-version: ['3.2', '3.1', '3.0', '2.7', '2.5', jruby] | |
env: | |
BUNDLE_WITH: ActiveRecord Sequel DataMapper mysql | |
MYSQL_HOST: 127.0.0.1 | |
MONETA_MYSQL_PASSWORD: moneta | |
steps: | |
- uses: actions/checkout@main | |
- name: Apt update | |
run: sudo apt-get update | |
- name: Apt install mysql packages | |
run: sudo apt-get install -y libmysqlclient-dev | |
- name: Create Database moneta | |
run: mysqladmin -h 127.0.0.1 -u root create moneta | |
env: | |
MYSQL_PWD: moneta | |
- name: Create Database moneta2 | |
run: mysqladmin -h 127.0.0.1 -u root create moneta2 | |
env: | |
MYSQL_PWD: moneta | |
- name: Set up Ruby ${{ matrix.ruby-version }} | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby-version }} | |
bundler: latest | |
bundler-cache: true | |
- name: Rspec | |
run: bundle exec rspec -t mysql -- spec/moneta | |
postgres-adapters: | |
name: "Postgres adapters" | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:15.2 | |
env: | |
POSTGRES_PASSWORD: moneta | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
strategy: | |
matrix: | |
ruby-version: ['3.2', '3.1', '3.0', '2.7', '2.5', jruby] | |
env: | |
BUNDLE_WITH: ActiveRecord Sequel DataMapper postgresql | |
PGHOST: localhost | |
PGUSER: postgres | |
PGPASSWORD: moneta | |
steps: | |
- uses: actions/checkout@main | |
- name: Create Database moneta1 | |
run: createdb moneta1 | |
- name: Create Database moneta2 | |
run: createdb moneta2 | |
- name: Add hstore support to moneta1 | |
run: psql -c 'create extension hstore;' moneta1 | |
- name: Set up Ruby ${{ matrix.ruby-version }} | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby-version }} | |
bundler: latest | |
bundler-cache: true | |
- name: Rspec | |
run: bundle exec rspec -t postgres -- spec/moneta | |
sqlite-adapters: | |
name: "SQLite adapters" | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
ruby-version: ['3.2', '3.1', '3.0', '2.7', '2.5', jruby] | |
env: | |
BUNDLE_WITH: ActiveRecord Sequel DataMapper sqlite | |
steps: | |
- uses: actions/checkout@main | |
- name: Set up Ruby ${{ matrix.ruby-version }} | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby-version }} | |
bundler: latest | |
bundler-cache: true | |
- name: Rspec | |
run: bundle exec rspec -t sqlite -- spec/moneta | |
h2-adapters: | |
name: "H2 adapters" | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
ruby-version: [jruby] | |
env: | |
BUNDLE_WITH: Sequel H2 | |
steps: | |
- uses: actions/checkout@main | |
- name: Set up Ruby ${{ matrix.ruby-version }} | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby-version }} | |
bundler: latest | |
bundler-cache: true | |
- name: Rspec | |
run: bundle exec rspec -t h2 -- spec/moneta | |
rails5: | |
name: "Rails 5" | |
runs-on: ubuntu-latest | |
services: | |
redis: | |
image: redis | |
options: >- | |
--health-cmd "redis-cli ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 6379:6379 | |
strategy: | |
matrix: | |
ruby-version: ['2.7', '2.5', jruby-9.3] | |
env: | |
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails5.gemfile | |
BUNDLE_WITH: sqlite active_support_cache | |
steps: | |
- uses: actions/checkout@main | |
- name: Apt update | |
run: sudo apt-get update | |
- name: Apt install memcached | |
run: sudo apt-get install -y memcached libsasl2-dev | |
- name: Set up Ruby ${{ matrix.ruby-version }} | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby-version }} | |
bundler: latest | |
bundler-cache: true | |
- name: Rspec ActiveRecord | |
run: bundle exec rspec -t sqlite -- spec/moneta/adapters/activerecord | |
- name: Rspec ActiveSupport::Cache | |
run: bundle exec rspec -- spec/active_support spec/moneta/adapters/activesupportcache | |
- name: Minitest | |
run: bundle exec ruby test/action_dispatch/session_moneta_store_test.rb | |
redis: | |
name: "Redis adapters" | |
runs-on: ubuntu-latest | |
services: | |
redis: | |
image: redis | |
options: >- | |
--health-cmd "redis-cli ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 6379:6379 | |
strategy: | |
matrix: | |
ruby-version: ['3.2', '3.1', '3.0', '2.7', '2.5', jruby] | |
env: | |
BUNDLE_WITH: Redis | |
steps: | |
- uses: actions/checkout@main | |
- name: Set up Ruby ${{ matrix.ruby-version }} | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby-version }} | |
bundler: latest | |
bundler-cache: true | |
- name: Rspec | |
run: bundle exec rspec -t adapter:Redis -t redis -- spec/moneta | |
memcached: | |
name: "Memcached adapters" | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
ruby-version: ['3.2', '3.1', '3.0', '2.7', '2.5', jruby] | |
env: | |
BUNDLE_WITH: Memcached | |
steps: | |
- uses: actions/checkout@main | |
- name: Apt update | |
run: sudo apt-get update | |
- name: Apt install memcached | |
run: sudo apt-get install -y memcached libsasl2-dev | |
- name: Set up Ruby ${{ matrix.ruby-version }} | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby-version }} | |
bundler: latest | |
bundler-cache: true | |
- name: Rspec | |
run: bundle exec rspec -t ~unstable -t adapter:Memcached -t memcached -- spec/moneta | |
mongo: | |
name: "Mongo adapter" | |
runs-on: ubuntu-latest | |
services: | |
mongo: | |
image: mongo:4.4 | |
options: >- | |
--health-cmd "mongo --eval db" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 27017:27017 | |
strategy: | |
matrix: | |
ruby-version: ['3.2', '3.1', '3.0', '2.7', '2.5', jruby] | |
env: | |
BUNDLE_WITH: Mongo | |
steps: | |
- uses: actions/checkout@main | |
- name: Set up Ruby ${{ matrix.ruby-version }} | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby-version }} | |
bundler: latest | |
bundler-cache: true | |
- name: Rspec | |
run: bundle exec rspec -t adapter:Mongo -- spec/moneta | |
residual-specs: | |
name: "Proxies and other specs" | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
ruby-version: ['3.2', '3.1', '3.0', '2.7', '2.5', jruby] | |
env: | |
BUNDLE_WITH: transformers GDBM Fog | |
steps: | |
- uses: actions/checkout@main | |
- name: Apt update | |
run: sudo apt-get update | |
- name: Apt install dependencies | |
run: sudo apt-get install -y libgdbm-dev liblzo2-dev | |
- name: Set up Ruby ${{ matrix.ruby-version }} | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby-version }} | |
bundler: latest | |
bundler-cache: true | |
- name: Rspec | |
run: bundle exec rspec -t ~unstable --exclude-pattern "./spec/{moneta/adapters/**/*,active_support/**/*}" | |
- name: Minitest | |
run: bundle exec ruby test/action_dispatch/session_moneta_store_test.rb | |
checks: | |
name: "General checks" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@main | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.2' | |
bundler: latest | |
bundler-cache: true | |
- name: Check FILES | |
run: ./script/check-files | |
- name: Rubocop | |
run: bundle exec rubocop lib |