diff --git a/.github/workflows/rubyonrails.yml b/.github/workflows/rubyonrails.yml new file mode 100644 index 0000000..577d7da --- /dev/null +++ b/.github/workflows/rubyonrails.yml @@ -0,0 +1,32 @@ +name: "Ruby on Rails CI" +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] +jobs: + test: + runs-on: ubuntu-latest + services: + postgres: + image: postgres:15-alpine + ports: + - "5432:5432" + env: + POSTGRES_DB: rails_test + POSTGRES_USER: rails + POSTGRES_PASSWORD: password + env: + RAILS_ENV: test + DATABASE_URL: "postgres://rails:password@localhost:5432/rails_test" + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Install Ruby and gems + uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0 + with: + bundler-cache: true + - name: Set up database schema + run: bin/rails db:schema:load + - name: Run tests + run: bundle exec rspec