Created
December 24, 2024 15:49
-
-
Save Pauloparakleto/79ee5c8240eb15b3b9a9fc4b0f7b039d to your computer and use it in GitHub Desktop.
Rails 8 github action
This file contains hidden or 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: Ruby | |
on: [pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
services: | |
db: | |
image: postgres:11 | |
ports: [ '5432:5432' ] | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
env: | |
POSTGRES_PASSWORD: 12345 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.3.6 | |
- name: Run the default task | |
env: | |
PGHOST: localhost | |
PGUSER: postgres | |
PGPASSWORD: 12345 | |
RAILS_ENV: test | |
run: | | |
sudo apt-get -yqq install libpq-dev | |
mv .env.test .env | |
gem install bundler -v 2.2.14 | |
bundle install | |
bundle exec rails db:create | |
bundle exec rails db:migrate | |
bundle exec rails db:seed | |
bundle exec rspec |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment