Testing workflow is launched by philbarker π #2
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 | |
run-name: Testing workflow is launched by ${{ github.actor }} π | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
types: [opened, synchronize, reopened, ready_for_review] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:13 | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: postgres | |
ports: | |
- 5432:5432 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
redis: | |
image: redis | |
ports: | |
- 6379:6379 | |
options: --entrypoint redis-server | |
env: | |
RAILS_ENV: test | |
POSTGRESQL_ADDRESS: localhost | |
POSTGRESQL_DATABASE: postgres | |
POSTGRESQL_USERNAME: postgres | |
POSTGRESQL_PASSWORD: postgres | |
POSTGRESQL_PORT: 5432 | |
DISABLE_SPRING: true | |
DISABLE_SPRING_WATCHER_LISTEN: true | |
DEFAULT_PASS: t3admint3admin | |
MAILGUN_API_KEY: ${{ secrets.MAILGUN_API_KEY }} | |
MAILGUN_DOMAIN: ${{ secrets.MAILGUN_DOMAIN }} | |
MAIL_PASSWORD: ${{ secrets.MAIL_PASSWORD }} | |
MAIL_USERNAME: ${{ secrets.MAIL_USERNAME }} | |
APP_DOMAIN: http://example.com | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Ruby for testing runner | |
uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
- name: Setup DB | |
run: | | |
bundle exec rake db:prepare | |
- name: Run tests | |
run: | | |
bundle exec rspec |