Skip to content

Commit

Permalink
ci: fix cucumber tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kaisen-san committed Nov 19, 2024
1 parent 16ee170 commit 054757f
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 24 deletions.
55 changes: 39 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,41 +15,64 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: [2.6, 2.7, 3.0]
ruby-version: [2.6, 2.7]
services:
postgres:
image: postgres:12.1-alpine
image: postgres:15
ports:
- 5432:5432
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
POSTGRES_HOST_AUTH_METHOD: trust
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout Project
uses: actions/checkout@v3

uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true

cache-version: 1
- name: Install Library Dependencies
run: sudo apt-get install libpq-dev

- name: Setup Database
run: |
cp config/database.yml.github-actions config/database.yml
env:
RAILS_ENV: test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres

PGHOST: localhost
PGPORT: 5432
PGDATABASE: prodder__blog_prod
PGUSER: postgres
PGPASSWORD: postgres
run: |
cat <<EOF > config/database.yml
test:
adapter: postgresql
encoding: unicode
pool: 20
database: prodder__blog_prod
migration_user: prodder
EOF
createuser --createrole --createdb prodder
- name: Test with RSpec
env:
RAILS_ENV: "test"
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
PGHOST: localhost
PGPORT: 5432
PGDATABASE: prodder__blog_prod
PGUSER: postgres
PGPASSWORD: postgres
run: |
bundle exec rspec
- name: Test with Cucumber
env:
PGHOST: localhost
PGPORT: 5432
PGDATABASE: prodder__blog_prod
PGUSER: postgres
PGPASSWORD: postgres
run: |
bundle exec cucumber
Empty file added config/.gitkeep
Empty file.
8 changes: 0 additions & 8 deletions config/database.yml.github-actions

This file was deleted.

0 comments on commit 054757f

Please sign in to comment.