Test with multiple DB engines #62
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: Test | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
rubocop: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: "3.2" | |
bundler-cache: true | |
- run: bundle exec rake rubocop | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
ruby-version: ["2.7", "3.0", "3.1", "3.2"] | |
database_url: | |
# - "sqlite3:///tmp/test.sqlite3" | |
# - "mysql2://root:root@localhost/runner" | |
- "postgres://runner:runner@localhost/runner" | |
env: | |
DATABASE_URL: ${{ matrix.database_url }} | |
RACK_ENV: test | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby-version }} | |
bundler-cache: true | |
- run: | | |
sudo systemctl start mysql.service | |
mysqladmin ping -h localhost -u root -proot | |
mysql -h localhost -u root -proot -e "CREATE DATABASE runner;" | |
- run: | | |
sudo systemctl start postgresql.service | |
pg_isready | |
PGPASSWORD=runner sudo -E -u postgres createuser -s -d runner | |
sudo -u postgres createdb -O runner runner | |
- run: | | |
bundle exec rake spec |