-
-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test full matrix of supported adapters
- Loading branch information
Showing
5 changed files
with
98 additions
and
7 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
name: Tests | ||
|
||
on: [push, pull_request] | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
gemstash_tests: | ||
|
@@ -9,6 +13,50 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
ruby: ["3.1", "3.2", "3.3", "jruby-9.4"] | ||
db_adapter: ["sqlite3"] | ||
cache_type: ["memory"] | ||
include: | ||
- ruby: "3.3" | ||
db_adapter: "postgres" | ||
cache_type: "memory" | ||
- ruby: "3.3" | ||
db_adapter: "mysql2" | ||
cache_type: "memory" | ||
- ruby: "3.3" | ||
db_adapter: "sqlite3" | ||
cache_type: "memcached" | ||
- ruby: "3.3" | ||
db_adapter: "sqlite3" | ||
cache_type: "redis" | ||
- ruby: "jruby-9.4" | ||
db_adapter: "sqlite3" | ||
cache_type: "memcached" | ||
- ruby: "jruby-9.4" | ||
db_adapter: "sqlite3" | ||
cache_type: "redis" | ||
services: | ||
postgres: | ||
image: postgres:13 | ||
env: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: gemstash_test | ||
ports: | ||
- 5432:5432 | ||
memcached: | ||
image: memcached:1.6 | ||
ports: | ||
- 11211:11211 | ||
redis: | ||
image: redis:7 | ||
ports: | ||
- 6379:6379 | ||
env: | ||
GEMSTASH_SPEC_CACHE_TYPE: ${{ matrix.cache_type }} | ||
GEMSTASH_SPEC_DB_ADAPTER: ${{ matrix.db_adapter }} | ||
GEMSTASH_SPEC_DB_URL: ${{ (matrix.db_adapter == 'postgres' && 'postgres://postgres:postgres@localhost/gemstash_test') || (matrix.db_adapter == 'mysql2' && 'mysql2://root:[email protected]:3306/gemstash_test') }} | ||
GEMSTASH_SPEC_REDIS_SERVERS: redis://localhost:6379 | ||
GEMSTASH_SPEC_MEMCACHED_SERVERS: localhost:11211 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup ruby | ||
|
@@ -18,8 +66,29 @@ jobs: | |
bundler-cache: true # 'bundle install' and cache | ||
- name: increase ulimit | ||
run: ulimit -n 8192 | ||
- name: Set up MySQL | ||
if: matrix.db_adapter == 'mysql2' | ||
run: | | ||
set -eux | ||
sudo /etc/init.d/mysql start | ||
mysql -e 'CREATE DATABASE gemstash_test;' --user=root --password=root | ||
mysqladmin ping --user=root --password=root | ||
- name: Run Tests | ||
run: bundle exec rspec --exclude-pattern "spec/integration_spec.rb" | ||
- name: Run Integration Tests | ||
run: bundle exec rspec ./spec/integration_spec.rb | ||
timeout-minutes: 60 | ||
|
||
all-tests-pass: | ||
if: always() | ||
|
||
needs: | ||
- gemstash_tests | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: check test jobs | ||
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2 | ||
with: | ||
jobs: ${{ toJSON(needs) }} |
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
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
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
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