NAME

Test::CPAN::Health::Check::CIConfig - Check that a CI configuration is present and valid

SYNOPSIS

use Test::CPAN::Health::Check::CIConfig;

my $check  = Test::CPAN::Health::Check::CIConfig->new;
my $result = $check->run($dist);

DESCRIPTION

Checks for the presence of a recognised CI configuration file and, where the format is YAML, validates that the file parses without errors.

Recognised CI systems:

  • GitHub Actions -- .github/workflows/*.yml

  • Travis CI -- .travis.yml

  • AppVeyor -- .appveyor.yml

  • Azure Pipelines -- azure-pipelines.yml

  • CircleCI -- .circleci/config.yml

  • Jenkins -- Jenkinsfile

Score matrix:

  • 100 -- at least one valid CI config found.

  • 70 -- CI config file(s) found but all YAML files failed to parse.

  • 0 -- no CI configuration found.

run

PURPOSE

Scan the distribution root for known CI configuration files and validate YAML ones for parse errors.

API SPECIFICATION

INPUT

dist     Test::CPAN::Health::Distribution  required
context  Hashref                           optional  (unused)

OUTPUT

Test::CPAN::Health::Result with:

check_id  'ci_config'
status    'pass' | 'warn' | 'fail'
score     100 | 70 | 0
summary   human-readable verdict
details   list of file names found or error descriptions

MESSAGES

Code  | Severity | Message                            | Resolution
------+----------+------------------------------------+---------------------
CI001 | FAIL     | No CI configuration found          | Add .github/workflows/ or .travis.yml
CI002 | WARN     | CI config found but YAML invalid   | Fix YAML syntax errors
CI003 | PASS     | CI configuration found             |

FORMAL SPECIFICATION

-- Z schema (placeholder) --
CIConfigOp
dist   : Distribution
files  : seq String
valid  : seq String
score  : {0, 70, 100}
-------------------------------------------------------
#files = 0  => score = 0
#valid > 0  => score = 100
#files > 0 /\ #valid = 0 => score = 70

SIDE EFFECTS

Reads CI configuration files from disk.

USAGE EXAMPLE

my $result = Test::CPAN::Health::Check::CIConfig->new->run($dist);

AUTHOR

Nigel Horne, <njh at nigelhorne.com>

LICENSE AND COPYRIGHT

Copyright (C) 2025-2026 Nigel Horne.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.