Rails 7.2.1.2 #1046
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: Tests | |
on: [push, pull_request] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:13 | |
ports: ['5432:5432'] | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: secret | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.3.3 | |
bundler-cache: true | |
- name: Install Elasticsearch | |
uses: ankane/setup-elasticsearch@v1 | |
with: | |
elasticsearch-version: 7.12.0 | |
- name: Verify Elasticsearch connection and create index | |
env: | |
ELASTICSEARCH_URL: http://localhost:9200 | |
run: | | |
echo $ELASTICSEARCH_URL | |
curl -fsSL "$ELASTICSEARCH_URL/_cat/health?h=status" | |
curl -X PUT $ELASTICSEARCH_URL/joss-production | |
- name: Run tests | |
env: | |
ELASTICSEARCH_URL: http://localhost:9200 | |
PGUSER: postgres | |
PGPASSWORD: secret | |
RAILS_ENV: test | |
GH_SECRET: 12345 | |
run: | | |
bundle exec rails db:create | |
bundle exec rails db:schema:load | |
bundle exec rails spec |