Skip to content

Commit 632cbdf

Browse files
committed
Integrate qlty to CI flow
1 parent 74988f8 commit 632cbdf

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ on:
77
pull_request:
88
branches: main
99

10+
# OIDC permissions for qlty
11+
permissions:
12+
contents: read
13+
id-token: write
14+
1015
jobs:
1116
test:
1217
runs-on: ubuntu-latest
@@ -20,7 +25,6 @@ jobs:
2025

2126
env:
2227
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
23-
#CC_TEST_REPORTER_ID: 9a84a9f695de3b120b6fcead4e089b45420f7518fb2123dc5424f862d381c4ff
2428

2529
steps:
2630
- name: Checkout code
@@ -38,3 +42,9 @@ jobs:
3842

3943
- name: Run linting
4044
run: bundle exec rake rubocop
45+
46+
- uses: qltysh/qlty-action/coverage@v2
47+
with:
48+
oidc: true
49+
format: simplecov
50+
files: coverage/.resultset.json

Rakefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,14 @@ RSpec::Core::RakeTask.new(:spec)
1313
require "rubocop/rake_task"
1414
RuboCop::RakeTask.new(:rubocop) do |t|
1515
# See https://docs.rubocop.org/rubocop/usage/basic_usage.html
16-
t.options = ['--display-cop-names', '--parallel']
16+
t.options = ["--display-cop-names", "--parallel"]
17+
end
18+
19+
desc "Run Qlty code analysis"
20+
task :qlty do
21+
sh "qlty smells --all"
22+
sh "qlty metrics --all --max-depth=2 --sort complexity --limit 10"
23+
# sh "qlty lint" # Just runs rubocop, not necessary as we have a task for this already
1724
end
1825

1926
# default task: Add spec and rubocop to default tasks.

scripts/setup

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@ set -vx
66
rvm install ruby-$(cat .ruby-version)
77
gem install bundler -v 2.2.18
88
bundle install
9+
10+
11+
# Qlty CLI tool. Ref: https://docs.qlty.sh/cli/quickstart
12+
curl https://qlty.sh | sh

0 commit comments

Comments
 (0)