From d28fa229da05c40047a96a8106246fe87b653d1e Mon Sep 17 00:00:00 2001 From: File Sync Date: Mon, 7 Aug 2023 06:45:54 +0000 Subject: [PATCH] Update .github/workflows/rubocop.yml Source file https://github.com/dry-rb/template-gem/blob/bc0198ee62ae2aaec784da5c915dcb80876a3556/.github/workflows/rubocop.yml --- .github/workflows/rubocop.yml | 66 +++++++++++++---------------------- 1 file changed, 24 insertions(+), 42 deletions(-) diff --git a/.github/workflows/rubocop.yml b/.github/workflows/rubocop.yml index d1b9799..e5caf68 100644 --- a/.github/workflows/rubocop.yml +++ b/.github/workflows/rubocop.yml @@ -1,46 +1,28 @@ -name: "RuboCop" -on: - push: - branches: - - "main" - - "master" - paths: - - "**/*.rb" - - "**/*.rake" - - "Rakefile" - - "Gemfile*" - - ".rubocop.yml" - pull_request: - branches: - - "main" - - "master" - types: - - "opened" - - "synchronize" - workflow_dispatch: +# frozen_string_literal: true + +# This file is synced from dry-rb/template-gem repo + +name: RuboCop + +on: [push, pull_request] + +permissions: + contents: read + jobs: - run: + build: runs-on: ubuntu-latest - name: ${{ matrix.type }} - strategy: - fail-fast: false - matrix: - type: ["Style", "Layout", "Naming", "Lint", "Metrics", "Security"] + env: + BUNDLE_ONLY: tools + steps: - - name: Clone - uses: actions/checkout@v2 - - name: Get git diff - id: get_diff - uses: technote-space/get-diff-action@v4 + - uses: actions/checkout@v3 + + - name: Set up Ruby 3.2 + uses: ruby/setup-ruby@v1 with: - PATTERNS: | - **/*.rb - **/*.rake - Gemfile - Rakefile - - name: Check ${{ matrix.type }} - uses: repobot-app/actions/rubocop@main - if: ${{ env.GIT_DIFF != '' }} - with: - diff: ${{ env.GIT_DIFF }} - type: ${{ matrix.type }} + ruby-version: 3.2 + bundler-cache: true + + - name: Run RuboCop + run: bundle exec rubocop --parallel