diff --git a/.github/workflows/run_specs.yml b/.github/workflows/run_specs.yml new file mode 100644 index 0000000..79fc95f --- /dev/null +++ b/.github/workflows/run_specs.yml @@ -0,0 +1,45 @@ +env: + RUBY_VERSION: 3.0.3 + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: programmingtil_rails_1_test +# DEVISE_JWT_SECRET_KEY: ${{ secrets.DEVISE_JWT_SECRET_KEY }} + +name: Rails Specs +on: [push,pull_request] +jobs: + rspec-test: + name: RSpec + runs-on: ubuntu-20.04 + services: + postgres: + image: postgres:latest + ports: + - 5432:5432 + env: + POSTGRES_USER: ${{ env.POSTGRES_USER }} + POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }} + steps: + - uses: actions/checkout@v1 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.0.3' # Not needed with a .ruby-version file + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + - name: Install postgres client + run: sudo apt-get install libpq-dev + - name: Install dependencies + run: | + gem install bundler + bundler install + - name: Create database + run: | + bundler exec rails db:create RAILS_ENV=test + bundler exec rails db:migrate RAILS_ENV=test + - name: Run tests + run: bundler exec rspec spec/* + - name: Upload coverage results + uses: actions/upload-artifact@master + if: always() + with: + name: coverage-report + path: coverage \ No newline at end of file diff --git a/spec/models/rent_spec.rb b/spec/models/rent_spec.rb new file mode 100644 index 0000000..e384e8f --- /dev/null +++ b/spec/models/rent_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe Rent, type: :model do + pending "add some examples to (or delete) #{__FILE__}" +end