Skip to content

Commit

Permalink
add GH Action to run tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SepsiLaszlo committed Sep 28, 2022
1 parent 4686338 commit be0c5c3
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/run_specs.yml
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions spec/models/rent_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require 'rails_helper'

RSpec.describe Rent, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end

0 comments on commit be0c5c3

Please sign in to comment.