Last active
October 16, 2020 06:41
-
-
Save stellamiranda/5fd24a89bd5b68f46e2f6d33ed295caf to your computer and use it in GitHub Desktop.
Gihub Actions workflow to run rspec on simple rails app
This file contains 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
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