Update credentials for tests #4
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: Test | |
on: | |
push: | |
branches: | |
- develop | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: | |
elasticsearch: | |
image: docker.elastic.co/elasticsearch/elasticsearch:7.9.2 | |
env: | |
STACK_VERSION: 7.17.1 | |
xpack.security.enabled: false | |
cluster.name: beckett-elasticsearch | |
http.port: 9200 | |
discovery.type: single-node | |
options: >- | |
--health-cmd "curl http://localhost:9200/_cluster/health" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 10 | |
ports: | |
- 9200:9200 | |
postgres: | |
image: postgres:10 | |
env: | |
POSTGRES_PASSWORD: password | |
POSTGRES_USER: user | |
POSTGRES_DB: beckett_test | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
redis: | |
image: redis | |
options: >- | |
--health-cmd "redis-cli ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 6379:6379 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
- name: Setup cache key and directory for gems cache | |
uses: actions/cache@v3 | |
with: | |
path: vendor/bundle | |
key: ${{ runner.os }}-gem-use-ruby-${{ hashFiles('**/Gemfile.lock') }} | |
- name: Install system requirements | |
run: | | |
sudo apt update | |
sudo apt install -y postgresql-client | |
- name: Bundle Install | |
run: | | |
bundle config path vendor/bundle | |
bundle install --jobs 4 --retry 3 | |
- name: Test with RSpec | |
id: rspec | |
env: | |
RAILS_ENV: test | |
DB_USERNAME: user | |
DB_HOSTNAME: localhost | |
DB_PASSWORD: password | |
DB_NAME: beckett_test | |
run: | | |
bundle exec rake db:create | |
bundle exec rake db:migrate | |
bundle exec rspec spec/ |