allow sqlite ci to fail #6
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: CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
ruby: ['3.3', '3.2', '3.1'] | |
database: ['sqlite', 'mysql', 'postgres'] | |
services: | |
mysql: | |
image: mysql:8.0 | |
ports: | |
- 3306:3306 | |
env: | |
MYSQL_ROOT_PASSWORD: root | |
MYSQL_DATABASE: test | |
options: >- | |
--health-cmd "mysqladmin ping --silent" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 3 | |
postgres: | |
image: postgres:14 | |
ports: | |
- 5432:5432 | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: test | |
options: >- | |
--health-cmd "pg_isready -U postgres" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 3 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{matrix.ruby}} | |
bundler-cache: true | |
- name: Setup database configuration | |
run: | | |
case ${{matrix.database}} in | |
sqlite) | |
echo "DATABASE_URL=sqlite3::memory:" >> $GITHUB_ENV | |
;; | |
mysql) | |
echo "DATABASE_URL=mysql2://root:root@localhost/test" >> $GITHUB_ENV | |
;; | |
postgres) | |
echo "DATABASE_URL=postgres://postgres:postgres@localhost/test" >> $GITHUB_ENV | |
;; | |
esac | |
- name: Wait for database | |
run: | | |
case ${{matrix.database}} in | |
mysql) | |
while ! mysqladmin ping -h"localhost" --silent; do sleep 1; done | |
;; | |
postgres) | |
while ! pg_isready -h "localhost" -U "postgres"; do sleep 1; done | |
;; | |
esac | |
- name: Test | |
run: bundle exec rake test | |
# sqlite is not supported yet because it doesn't support | |
# the union syntax we're using | |
continue-on-error: ${{matrix.database == 'sqlite'}} |