Upgrade GitHub Actions PostgreSQL to v16 #57
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: | |
pull_request: | |
paths-ignore: | |
- 'README.md' | |
push: | |
paths-ignore: | |
- 'README.md' | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
ruby_version: ['3.0', '3.1', '3.2'] | |
rails_version: ['6.1', '7.0', '7.1'] | |
exclude: | |
- ruby_version: 3.1 | |
rails_version: 6.1 | |
- ruby_version: 3.2 | |
rails_version: 6.1 | |
services: | |
db: | |
image: postgres:16 | |
ports: ["5432:5432"] | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby_version }} | |
- name: Build and run test | |
env: | |
DATABASE_URL: postgres://postgres:@localhost:5432/test | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
run: | | |
sudo apt-get -yqq install libpq-dev | |
bundle | |
bundle exec appraisal rails_${{ matrix.rails_version }} bundle | |
bundle exec appraisal rails_${{ matrix.rails_version }} rake |