App-Actions
view release on metacpan or search on metacpan
lib/App/Actions.pm view on Meta::CPAN
option values there in ASCII.
=head1 SEE ALSO
=over 4
=item * L<Configure an Object at Runtime|Object::Configure>, which L</new>
uses to read configuration files and environment variables
=item * L<Config::Abstraction>, which finds and reads those files
=item * L<Test Dashboard|https://nigelhorne.github.io/App-Actions/coverage/>
=back
=head1 AUTHOR
Nigel Horne, C<< <njh at nigelhorne.com> >>
=encoding utf-8
=head1 FORMAL SPECIFICATION
This section describes each routine in the Z notation, a precise
mathematical language for describing programs. You do not need to read it
to use the module: everything here is also said in plain words in the
sections above. It is for readers who want to check exactly what a routine
promises.
How to read it: a box names a routine. The lines above the middle rule
declare the values it works with. A name ending in C<?> is an input, and a
name ending in C<!> is an output. C<ÎState> means the routine changes
nothing, and C<ÎState> means it can change the state. The lines below the
rule are the conditions that are always true when the routine returns.
=head2 new
ââ New âââââââââââââââââââââââââââââââââââââââââââââ
â ÎFileSystem
â workflowFile? : optional PATH
â projectDir? : optional PATH
â options? : OPTION ⸠VALUE
â actions! : Actions
ââââââââââââââââââââââââââââââââââââââââââââââââââââ
â dom options? â RUNNER_OPTIONS
â let settings == (args? â fileConfig(App__Actions)) â envConfig(App__Actions__)
â where args? == options? ⪠{workflow_file ⦠workflowFile?, project_dir ⦠projectDir?}
â -- dom fileConfig and dom envConfig are not checked against RUNNER_OPTIONS
â workflowFile? = ⥠â raises WorkflowFileRequired
â abs(workflowFile?) â regularFiles â raises WorkflowFileMissing
â projectDir? = ⥠⧠abs(workflowFile?) â (PATH â "/.github/workflows/" â NAME)
â â raises ProjectDirRequired
â let root == (projectDir? â ⥠â abs(projectDir?))
â â§ (projectDir? = ⥠â repository(abs(workflowFile?)))
â root â directories â raises ProjectDirMissing
â actions!.workflow = Workflow.Load(abs(workflowFile?))
â actions!.project_dir = root
â actions!.options = settings
â let logged == (logger? â ⥠â logger?)
â â§ (logger? = ⥠⧠logger â dom configured â configured(logger))
â â§ (logger? = ⥠⧠logger â dom configured â stderrLogger)
â where configured == fileConfig(App__Actions) â envConfig(App__Actions__)
â -- fileConfig includes the UNIVERSAL section of universal.yaml
â actions!.logger â LogAbstraction
â logged = NULL â actions!.logger = silentLogger
â logged â NULL â actions!.logger = toLogger(logged)
ââââââââââââââââââââââââââââââââââââââââââââââââââââ
The workflowFile? and projectDir? above are the values in settings, so a
configuration file or environment variable can replace them too.
=head2 workflow, workflow_file, project_dir
ââ Accessor ââââââââââââââââââââââââââââââââââââââââ
â ÎActions
â field? : {workflow, workflow_file, project_dir}
â value! : VALUE
ââââââââââââââââââââââââââââââââââââââââââââââââââââ
â value! = θActions.field?
ââââââââââââââââââââââââââââââââââââââââââââââââââââ
=head2 run
ââ Run âââââââââââââââââââââââââââââââââââââââââââââ
â ÎActions
â overrides? : OPTION ⸠VALUE
â exit! : {0, 1, 2}
ââââââââââââââââââââââââââââââââââââââââââââââââââââ
â dom overrides? â RUNNER_OPTIONS
â exit! = Runner.Run(options â overrides?)
ââââââââââââââââââââââââââââââââââââââââââââââââââââ
=head2 preflight
ââ Preflight âââââââââââââââââââââââââââââââââââââââ
â ÎActions
â overrides? : OPTION ⸠VALUE
â json? : optional BOOLEAN
â result! : Result
ââââââââââââââââââââââââââââââââââââââââââââââââââââ
â dom overrides? â RUNNER_OPTIONS
â result! = Runner.Preflight(options â overrides?, json?)
â result!.exit â {0, 2}
â json? â valid(result!.summary, PreflightSchema)
ââââââââââââââââââââââââââââââââââââââââââââââââââââ
=head2 json_schema
DOCUMENT ::= check | preflight | cache | logs
ââ JsonSchema ââââââââââââââââââââââââââââââââââââââ
â name? : optional STRING
â schema! : KEY ⸠VALUE
ââââââââââââââââââââââââââââââââââââââââââââââââââââ
â name? â {â¥, â¨â©} â raises DocumentRequired
â name? â DOCUMENT â raises DocumentUnknown(name?)
â name? â DOCUMENT â schema! = owner(name?).json_schema
ââââââââââââââââââââââââââââââââââââââââââââââââââââ
=head2 list_jobs
( run in 0.593 second using v1.01-cache-2.11-cpan-60884a8df76 )