Merge pull request #805 from yuki0920/fix/cloudrun-service-deploy #1353
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: Rspec | |
on: [push] | |
jobs: | |
rspec: | |
name: Run rspec | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./ruby | |
services: | |
postgres: | |
image: postgres:12.7 | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: test | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
env: | |
RAILS_ENV: test | |
POSTGRES_HOST: postgres | |
RAILS_DATABASE_USER: postgres | |
RAILS_DATABASE_PASSWORD: password | |
DATABASE_URL: postgres://postgres:postgres@localhost:5432/test | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.1.4 | |
bundler-cache: true | |
working-directory: ./ruby | |
- name: setup DB | |
run: | | |
bundle exec rails db:migrate | |
- name: Run tests | |
run: bundle exec rspec |