Merge pull request #220 from transientBug/bugfixes #323
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: Specs | |
on: | |
pull_request: | |
branches: | |
- '*' | |
push: | |
branches: | |
- master | |
jobs: | |
RSpec: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:14.2 | |
ports: | |
- 5432/tcp | |
env: | |
POSTGRES_USER: "postgres" | |
POSTGRES_PASSWORD: "testing" | |
POSTGRES_DATABASE: "transientbug_test" | |
redis: | |
image: redis:6.2.6 | |
ports: | |
- 6379/tcp | |
env: | |
RAILS_ENV: test | |
NODE_ENV: test | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install libraries | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y postgresql-client libpq-dev sqlite3 libsqlite3-dev | |
- uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '16' | |
cache: 'yarn' | |
- name: Setup Database | |
run: bundle exec rails db:prepare | |
env: | |
DATABASE_URL: postgresql://postgres:testing@localhost:${{ job.services.postgres.ports['5432'] }}/transientbug_test | |
REDIS_URL: redis://localhost:${{ job.services.redis.ports['6379'] }}/0 | |
- name: Run specs | |
run: bundle exec rails spec | |
env: | |
DATABASE_URL: postgresql://postgres:testing@localhost:${{ job.services.postgres.ports['5432'] }}/transientbug_test | |
REDIS_URL: redis://localhost:${{ job.services.redis.ports['6379'] }}/0 | |
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} |