diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 6a9701a..b6e7085 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -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 \ No newline at end of file diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..60d43a4 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,4 @@ +require: rubocop-rails + +AllCops: + NewCops: enable diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..acf9bf0 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +3.2.2 \ No newline at end of file diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..16d4177 --- /dev/null +++ b/Gemfile @@ -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' diff --git a/README.md b/README.md index 45c921f..fa1f347 100644 --- a/README.md +++ b/README.md @@ -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