Skip to content
This repository has been archived by the owner on Dec 26, 2024. It is now read-only.

Commit

Permalink
Fix Ruby workflow (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
willboland authored Apr 10, 2023
1 parent 3d0faef commit a6d4726
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 13 deletions.
29 changes: 16 additions & 13 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,26 @@ on:
branches: [ "main" ]

jobs:

lint:
name: Lint
runs-on: ubuntu-latest
name: Lint
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
fetch-depth: 0
- name: Run rubocop on project
uses: github/super-linter/slim@v4
env:
VALIDATE_RUBY: true
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
bundler-cache: true
- name: Run Rubocop
run: bundle exec rubocop

rspec:
test:
runs-on: ubuntu-latest
name: Test
steps:
- name: Test
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Run rspec
run: bundle exec rspec
4 changes: 4 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
require: rubocop-rails

AllCops:
NewCops: enable
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.2.2
10 changes: 10 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true

source 'https://rubygems.org'

git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }

gem 'rails'
gem 'rspec'
gem 'rubocop'
gem 'rubocop-rails'
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ The basic building blocks for ruby-on-rails repositories. This template holds:
- Pull request template
- Standard .gitignore

**You will still need to run `rails new $APP_NAME`** or **`bundle exec rails new $APP_NAME`.**

## GitHub Workflow
The [Ruby workflow](.github/workflows/ruby.yml):
- Runs `rubocop` on the project
Expand Down

0 comments on commit a6d4726

Please sign in to comment.