Skip to content

Activity tracking

Activity tracking #4

Workflow file for this run

# .github/workflows/rubocop.yml
# https://lovro-bikic.github.io/github-actions-rubocop-workflow/
#
name: RuboCop
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
push:
branches:
- main
jobs:
rubocop:
runs-on: ubuntu-latest
timeout-minutes: 10
env:
RUBOCOP_CACHE_ROOT: tmp/rubocop
steps:
- name: Git checkout
uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Prepare RuboCop cache
uses: actions/cache@v4
env:
DEPENDENCIES_HASH: ${{ hashFiles('.ruby-version', '**/.rubocop.yml', '**/.rubocop_todo.yml', 'Gemfile.lock') }}
with:
path: ${{ env.RUBOCOP_CACHE_ROOT }}
key: rubocop-cache-${{ runner.os }}-${{ env.DEPENDENCIES_HASH }}-${{ github.ref_name == github.event.repository.default_branch && github.run_id || 'default' }}
restore-keys: |
rubocop-cache-${{ runner.os }}-${{ env.DEPENDENCIES_HASH }}-
- name: Run RuboCop
run: bundle exec rubocop --format github --format clang