File tree Expand file tree Collapse file tree 3 files changed +30
-1
lines changed
lib/rails/generators/rails Expand file tree Collapse file tree 3 files changed +30
-1
lines changed Original file line number Diff line number Diff line change 1+ * Add RuboCop cache restoration to RuboCop job in GitHub Actions workflow templates.
2+
3+ * Lovro Bikić*
4+
15* Skip generating mailer-related files in authentication generator if the application does
26 not use ActionMailer
37
Original file line number Diff line number Diff line change 4848<%- unless skip_rubocop? -%>
4949 lint:
5050 runs-on: ubuntu-latest
51+ env:
52+ RUBOCOP_CACHE_ROOT: tmp/rubocop
5153 steps:
5254 - name: Checkout code
5355 uses: actions/checkout@v4
5860 ruby-version: .ruby-version
5961 bundler-cache: true
6062
63+ - name: Prepare RuboCop cache
64+ uses: actions/cache@v4
65+ env:
66+ DEPENDENCIES_HASH: ${{ hashFiles('.ruby-version', '**/.rubocop.yml', 'Gemfile.lock') }}
67+ with:
68+ path: ${{ env.RUBOCOP_CACHE_ROOT }}
69+ key: rubocop-${{ runner.os }}-${{ env.DEPENDENCIES_HASH }}-${{ github.ref_name == github.event.repository.default_branch && github.run_id || 'default' }}
70+ restore-keys: |
71+ rubocop-${{ runner.os }}-${{ env.DEPENDENCIES_HASH }}-
72+
6173 - name: Lint code for consistent style
6274 run: bin/rubocop -f github
6375
Original file line number Diff line number Diff line change 99<%- unless skip_rubocop? -%>
1010 lint:
1111 runs-on: ubuntu-latest
12+ env:
13+ RUBY_VERSION: <%= ENV["RBENV_VERSION"] || ENV["rvm_ruby_string"] || "#{RUBY_ENGINE}-#{RUBY_ENGINE_VERSION}" %>
14+ RUBOCOP_CACHE_ROOT: tmp/rubocop
1215 steps:
1316 - name: Checkout code
1417 uses: actions/checkout@v4
1518
1619 - name: Set up Ruby
1720 uses: ruby/setup-ruby@v1
1821 with:
19- ruby-version: <%= ENV["RBENV_VERSION"] || ENV["rvm_ruby_string"] || "#{RUBY_ENGINE}-#{RUBY_ENGINE_VERSION}" %>
22+ ruby-version: ${{ env.RUBY_VERSION }}
2023 bundler-cache: true
2124
25+ - name: Prepare RuboCop cache
26+ uses: actions/cache@v4
27+ env:
28+ DEPENDENCIES_HASH: ${{ hashFiles('**/.rubocop.yml', 'Gemfile.lock') }}
29+ with:
30+ path: ${{ env.RUBOCOP_CACHE_ROOT }}
31+ key: rubocop-${{ runner.os }}-${{ env.RUBY_VERSION }}-${{ env.DEPENDENCIES_HASH }}-${{ github.ref_name == github.event.repository.default_branch && github.run_id || 'default' }}
32+ restore-keys: |
33+ rubocop-${{ runner.os }}-${{ env.RUBY_VERSION }}-${{ env.DEPENDENCIES_HASH }}-
34+
2235 - name: Lint code for consistent style
2336 run: bin/rubocop -f github
2437
You can’t perform that action at this time.
0 commit comments