Skip to content

Commit

Permalink
Remove DB specific testing
Browse files Browse the repository at this point in the history
  • Loading branch information
westonganger committed Oct 14, 2023
1 parent bd6585a commit fec16da
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 116 deletions.
114 changes: 0 additions & 114 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,117 +61,3 @@ jobs:
- name: Run tests
run: |
bundle exec rake
test_mysql:
runs-on: ubuntu-20.04
services:
mysql:
image: mariadb
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: test
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
ports: ['3306:3306']

strategy:
fail-fast: false
matrix:
include:
### RAILS VERSION TESTING
### DONT WORRY ABOUT TESTING ALL RUBY VERSIONS. THIS IS COVERED IN THE SQLITE3 TESTS
- ruby: 2.6
env:
RAILS_VERSION: "5.0"
- ruby: 2.6
env:
RAILS_VERSION: "5.1"
- ruby: 2.6
env:
RAILS_VERSION: "5.2"
- ruby: 2.6
env:
RAILS_VERSION: "6.0"
- ruby: 2.6
env:
RAILS_VERSION: "6.1"
- ruby: "3.1"
env:
RAILS_VERSION: "7.0"

env:
BUNDLE_GEMFILE: "${{ matrix.gemfile }}"
DB_GEM: "mysql2"

steps:
- uses: actions/checkout@v3

- name: Install ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "${{ matrix.ruby }}"
bundler-cache: true

- name: Run tests
env:
DATABASE_URL: mysql2://root:[email protected]:3306/test
RAILS_ENV: test
run: |
bundle exec rake
test_pg:
runs-on: ubuntu-20.04
services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: test
ports: ['5432:5432']

strategy:
fail-fast: false
matrix:
include:
### RAILS VERSION TESTING
### DONT WORRY ABOUT TESTING ALL RUBY VERSIONS. THIS IS COVERED IN THE SQLITE3 TESTS
- ruby: 2.6
env:
RAILS_VERSION: "5.0"
- ruby: 2.6
env:
RAILS_VERSION: "5.1"
- ruby: 2.6
env:
RAILS_VERSION: "5.2"
- ruby: 2.6
env:
RAILS_VERSION: "6.0"
- ruby: 2.6
env:
RAILS_VERSION: "6.1"
- ruby: "3.1"
env:
RAILS_VERSION: "7.0"

env:
BUNDLE_GEMFILE: "${{ matrix.gemfile }}"
DB_GEM: "pg"

steps:
- uses: actions/checkout@v3

- name: Install ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "${{ matrix.ruby }}"
bundler-cache: true

- name: Run tests
env:
DATABASE_URL: postgres://postgres:password@localhost:5432/test
RAILS_ENV: test
run: |
bundle exec rake
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,10 @@ Run server using: `bin/dev` or `cd test/dummy/; rails s`
bundle exec rspec
```

We can locally test different versions of Rails using `ENV['RAILS_VERSION']` and different database gems using `ENV['DB_GEM']`
We can locally test different versions of Rails using `ENV['RAILS_VERSION']`

```
export RAILS_VERSION=7.0
export DB_GEM=sqlite3
bundle install
bundle exec rspec
```
Expand Down

0 comments on commit fec16da

Please sign in to comment.