From 134752af754593bdf98efee1770dc7f7652d97b5 Mon Sep 17 00:00:00 2001 From: Felipe Andrade Date: Tue, 19 Nov 2024 00:58:06 -0300 Subject: [PATCH] ci: fix cucumber tests --- .github/workflows/ci.yml | 50 ++++++++++++++++++++---------- config/.gitkeep | 0 config/database.yml.github-actions | 8 ----- 3 files changed, 33 insertions(+), 25 deletions(-) create mode 100644 config/.gitkeep delete mode 100644 config/database.yml.github-actions diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 00a3072..eb1bd95 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 < 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 diff --git a/config/.gitkeep b/config/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/config/database.yml.github-actions b/config/database.yml.github-actions deleted file mode 100644 index 0724691..0000000 --- a/config/database.yml.github-actions +++ /dev/null @@ -1,8 +0,0 @@ -test: - adapter: postgresql - host: localhost - encoding: unicode - database: github-actions - pool: 20 - username: <%= ENV["POSTGRES_USER"] %> - password: <%= ENV["POSTGRES_PASSWORD"] %>