Move setting of default languages to after_initialize and cleanup code #3705
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: Rails | |
on: [push, pull_request] | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
env: | |
PGHOST: localhost | |
POSTGRES_DB: skills_test | |
POSTGRES_USER: skills | |
POSTGRES_PASSWORD: skills | |
services: | |
postgres: | |
image: postgres:16 | |
ports: ["5432:5432"] | |
env: | |
POSTGRES_DB: ${{ env.POSTGRES_DB }} | |
POSTGRES_USER: ${{ env.POSTGRES_USER }} | |
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }} | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- name: 'Checkout' | |
uses: actions/checkout@v4 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: 'Run database migrations' | |
env: | |
RAILS_ENV: test | |
RAILS_DB_HOST: ${{ env.PGHOST }} | |
RAILS_DB_NAME: ${{ env.POSTGRES_DB }} | |
RAILS_DB_USERNAME: ${{ env.POSTGRES_USER }} | |
RAILS_DB_PASSWORD: ${{ env.POSTGRES_PASSWORD }} | |
run: | | |
bundle exec rake db:create db:migrate | |
- name: 'Run tests' | |
env: | |
PGHOST: ${{ env.PGHOST }} | |
RAILS_DB_NAME: ${{ env.POSTGRES_DB }} | |
RAILS_DB_USERNAME: ${{ env.POSTGRES_USER }} | |
RAILS_DB_PASSWORD: ${{ env.POSTGRES_PASSWORD }} | |
IS_CI: true | |
run: bundle exec rake | |
- name: 'Run RuboCop' | |
run: bundle exec rubocop --parallel |