Add support for rails 8 #127
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: Build | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
ruby-version: ["3.1", "3.2", "3.3"] | |
database: | |
- sqlite | |
- postgresql | |
- mysql | |
gemfile: | |
- Gemfile | |
- spec/ci/rails72.gemfile | |
- spec/ci/rails71.gemfile | |
- spec/ci/rails70.gemfile | |
exclude: | |
- gemfile: Gemfile | |
- ruby-version: "3.1" | |
services: | |
postgresql: | |
image: postgres:16 | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_DB: postgres | |
POSTGRES_PASSWORD: postgres | |
ports: ["5432:5432"] | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
mysql: | |
image: mysql:5.7 | |
env: | |
MYSQL_ALLOW_EMPTY_PASSWORD: yes | |
ports: ["3306:3306"] | |
options: >- | |
--health-cmd="mysqladmin ping" | |
--health-interval=10s | |
--health-timeout=5s | |
--health-retries=3 | |
env: | |
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }} | |
DB: ${{ matrix.database }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby-version }} | |
bundler-cache: true | |
- name: Prepare database | |
env: | |
PGPASSWORD: postgres | |
run: | | |
bundle exec rake db:drop | |
bundle exec rake db:create | |
- name: Run tests | |
run: bundle exec rake | |
- name: Report to coveralls | |
if: | | |
github.repository == 'joshwlewis/validates_by_schema' && | |
matrix.gemfile == 'Gemfile' && | |
matrix.ruby-version == '3.2' && | |
matrix.database == 'postgresql' | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
path-to-lcov: "./coverage/lcov.info" |