Skip to content

Portabilis patch 20/06/2024 #119

Portabilis patch 20/06/2024

Portabilis patch 20/06/2024 #119

Workflow file for this run

name: Tests
on:
push:
branches:
- main
- tc-gh-actions
pull_request:
jobs:
default:
name: Unit and Integration
if: "! github.event.pull_request.draft"
runs-on: ubuntu-latest
env:
RAILS_ENV: test
services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: idiario_test
ports:
- 5432:5432
options: --health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 3
redis:
image: redis
ports:
- 6379:6379
options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 3
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Ruby and install gems
uses: ruby/setup-ruby@v1
with:
ruby-version: "2.6.6"
bundler: "2.4.22"
bundler-cache: true
env:
ImageOS: ubuntu20
- name: Configure database
run: cp config/database.sample.yml config/database.yml
- name: Configure secrets
run: |
echo -e "
test:
secret_key_base: `bundle exec rake secret`
REDIS_URL: 'redis://localhost:6379/'
REDIS_DB_CACHE: '0'
REDIS_DB_SESSION: '1'
REDIS_DB_SIDEKIQ: '2'
REDIS_MODE: 'standalone'
" > config/secrets.yml
- name: Migrate
run: RAILS_ENV=test bundle exec rake db:migrate
- name: Tests
run: bundle exec rspec --exclude-pattern 'spec/acceptance/*.feature'