Module: Fluence::Ci::Tools::Steps
- Included in:
- Runner
- Defined in:
- lib/fluence/ci/tools/steps.rb
Overview
Mixin that adds the curated check groups to anything exposing a
step(label, command) method. Mirrors the centralised CI
workflows in fluence-eu/ci-workflows.
Each group method takes a report: boolean kwarg. With
report: false (the default) the underlying tools print
human-readable output to the console — what devs want for
local pre-push runs. With report: true the same tools are
invoked with their machine-output flags and write to a
standardised path under the project root, so the centralised
CI workflows can pick the artefact up for baseline diffs:
* lint → tmp/fluence-report/rubocop.json
* security → tmp/fluence-report/{brakeman.json,audit.txt,ruby_audit.txt}
* codequality → tmp/fluence-report/{reek.json,flog.txt,flay.txt}
* docs → doc/yardstick_report.txt (via the in-process
{Fluence::Ci::Tools::YardstickRunner} — no consumer Rakefile
dependency; honours `.yardstick.yml`)
tests does not take report: — coverage is captured as a
side effect by SimpleCov's spec_helper integration, the same
coverage/coverage.json file is produced regardless of mode.
Constant Summary collapse
- REPORT_DIR =
Path under the project root where every machine-readable report lands when
report: true. Conventionally gitignored (Ruby projects already gitignoretmp/). 'tmp/fluence-report'
Instance Method Summary collapse
-
#all(report: false, **overrides) ⇒ void
Run every step group in the catalog.
-
#codequality(paths: nil, report: false) ⇒ void
Run the code-smell suite (reek, flog, flay).
-
#docs(build: false, report: false) ⇒ void
Validate, build, or measure documentation.
-
#lint(report: false) ⇒ void
Run the rubocop lint step.
-
#security(report: false) ⇒ void
Run the security audit suite (brakeman, bundler-audit, ruby_audit).
-
#tests(command: nil) ⇒ void
Run the project's test suite(s).
Instance Method Details
#all(report: false, **overrides) ⇒ void
This method returns an undefined value.
Run every step group in the catalog. Adding a new group method makes it appear automatically. Override per-group kwargs via a hash keyed by method name.
#codequality(paths: nil, report: false) ⇒ void
This method returns an undefined value.
Run the code-smell suite (reek, flog, flay).
Defaults paths to lib, or app lib if an app/ directory
exists (Rails app / engine). Override explicitly otherwise.
#docs(build: false, report: false) ⇒ void
This method returns an undefined value.
Validate, build, or measure documentation. Three orthogonal
modes (report: wins over build:, default is the smoke
parse):
* default — `yard doc --no-output --no-stats`, a
parse-only smoke check that the docstrings compile. No
HTML, no stats, no threshold gate. Used by local pre-push
and the consumer's main matrix.
* `build: true` — `yard doc`, produces the HTML site
under `doc/`. Used by `ruby-gem-docs-deploy.yml`.
* `report: true` — invokes the in-process
{Fluence::Ci::Tools::YardstickRunner} which reads
`.yardstick.yml`, writes `doc/yardstick_report.txt`, and
exits 1 below threshold. Used by
`ruby-gem-docs-measure.yml`.
#lint(report: false) ⇒ void
This method returns an undefined value.
Run the rubocop lint step.
#security(report: false) ⇒ void
This method returns an undefined value.
Run the security audit suite (brakeman, bundler-audit, ruby_audit).
#tests(command: nil) ⇒ void
This method returns an undefined value.
Run the project's test suite(s). Detects rspec / minitest
presence via spec/spec_helper.rb / test/test_helper.rb.
Coverage (coverage/coverage.json) is captured automatically
by SimpleCov when configured in the consumer's spec_helper.
Pass command: explicitly to bypass detection.