Skip to content

Instantly share code, notes, and snippets.

@stellamiranda
Last active October 16, 2020 06:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stellamiranda/5fd24a89bd5b68f46e2f6d33ed295caf to your computer and use it in GitHub Desktop.
Save stellamiranda/5fd24a89bd5b68f46e2f6d33ed295caf to your computer and use it in GitHub Desktop.
Gihub Actions workflow to run rspec on simple rails app
env:
RUBY_VERSION: 2.7.1
name: Rails tests
on: [push,pull_request]
jobs:
rspec-test:
name: RSpec
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- uses: actions/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}
- 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 rake
- name: Upload coverage results
uses: actions/upload-artifact@master
if: always()
with:
name: coverage-report
path: coverage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment