forked from crmne/ruby_llm
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (62 loc) · 1.76 KB
/
_lint.yml
File metadata and controls
69 lines (62 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: _Lint
on:
workflow_call:
inputs:
ruby-version:
description: Ruby version for linting
required: false
type: string
default: "4.0"
checkout-repository:
description: Optional repository to checkout (owner/repo)
required: false
type: string
default: ""
checkout-ref:
description: Optional ref/SHA to checkout
required: false
type: string
default: ""
working-directory:
description: Directory to run bundler/rubocop in
required: false
type: string
default: "."
bundler-cache:
description: Enable Bundler cache
required: false
type: boolean
default: false
permissions:
contents: read
jobs:
lint:
name: Lint (RuboCop)
runs-on: ubuntu-latest
env:
BUNDLE_PATH: vendor/bundle
BUNDLE_DISABLE_SHARED_GEMS: "true"
steps:
- uses: actions/checkout@v6
if: inputs.checkout-repository == ''
with:
fetch-depth: 1
- uses: actions/checkout@v6
if: inputs.checkout-repository != ''
with:
repository: ${{ inputs.checkout-repository }}
ref: ${{ inputs.checkout-ref }}
fetch-depth: 1
persist-credentials: false
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ inputs.ruby-version }}
bundler-cache: ${{ inputs.bundler-cache }}
working-directory: ${{ inputs.working-directory }}
- name: Install dependencies
working-directory: ${{ inputs.working-directory }}
run: bundle install
- name: Run RuboCop
working-directory: ${{ inputs.working-directory }}
run: bundle exec rubocop