Merge pull request #12 from roberthopman/dependabot/bundler/rack-2.2.8.1 #29
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: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:14.8 | |
ports: ["5432:5432"] | |
env: | |
POSTGRES_DB: granny_test | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
env: | |
RAILS_ENV: test | |
DATABASE_URL: postgres://postgres:postgres@localhost:5432/granny_test | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
- name: Create Database | |
run: bin/rails db:create | |
- name: Migrate Database | |
run: bin/rails db:migrate | |
- name: Build tailwind | |
run: bin/rails tailwindcss:build | |
- name: Run tests | |
run: bin/rails test |