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 134752a
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 25 deletions.
50 changes: 33 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,42 +14,58 @@ jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby-version: [2.6, 2.7, 3.0]
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

- 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
PGUSER: postgres
PGPASSWORD: postgres
run: |
cat <<EOF > config/database.yml
test:
adapter: postgresql
encoding: unicode
pool: 20
database: github-actions
EOF
- name: Test with RSpec
env:
RAILS_ENV: "test"
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
run: |
bundle exec rspec
PGHOST: localhost
PGPORT: 5432
PGUSER: postgres
PGPASSWORD: postgres
run: bundle exec rspec
- name: Test with Cucumber
env:
PGHOST: localhost
PGPORT: 5432
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 134752a

Please sign in to comment.