Replace Travis with GitHub Actions #1
Workflow file for this run
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
name: CI | |
on: | |
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request | |
# opened, synchronize, reopened by default | |
pull_request: | |
push: | |
branches: | |
- main # only on push to main branch | |
jobs: | |
tests: | |
name: Tests | |
runs-on: ubuntu-latest | |
steps: | |
# https://github.com/marketplace/actions/checkout | |
- uses: actions/checkout@v4 # download the repository | |
# https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: .ruby-version # read from file | |
bundler-cache: true # automatically run bundle install and cache the result | |
- name: Prepare DB | |
env: | |
RAILS_ENV: test | |
run: bundle exec rake db:schema:load | |
- name: Run Tests | |
env: | |
RAILS_ENV: test | |
run: bundle exec rails test |