csspin_workflows.stdworkflows
The csspin_workflows.stdworkflows plugin provides a way to run multiple spin
tasks in sequence with a single command using so-called “workflows”.
csspin_workflows.stdworkflows ships the following workflows:
build (running tasks decorated by
@task(when="build")`)cept / acceptance (… by
@task(when="cept"))test / tests (… by
@task(when="test"))preflight (… by
@task(when="test")and@task(when="cept"))lint / check (… by
@task(when="lint"))localize (… by
@task(when="localize"))sbom (invoking
sbom:build,sbom:assemble, andsbom:enrichin sequence, with optional subcommands for individual steps)
How to setup the csspin_workflows.stdworkflows plugin?
For using the csspin_workflows.stdworkflows plugin, a project’s spinfile.yaml
must at least contain the following configuration.
spinfile.yaml to setup csspin_workflows.stdworkflowsplugin_packages:
- csspin-workflows
plugins:
- csspin_workflows.stdworkflows
The provisioning of the required virtual environment can be done via the
well-known spin provision-command. For using the plugin it is recommended
to provision further plugins that make use of the @task(when=)-decorator.
How to run a basic workflow?
A basic workflow like “test” can be run by having at least one plugin enabled that implements a task decorated by “test”. (If there is no such plugin, nothing will happen.)
In the following, this is demonstrated using the spin_python.pytest plugin.
plugin_packages:
- csspin-workflows
- csspin-python
plugins:
- csspin_workflows.stdworkflows
- spin_python.pytest
python:
version: "3.11.9"
...
After provisioning, the “test” workflow can be run using spin test, which
will automatically collect the “pytest” task and execute it.
How to run all unit and acceptance tests of a CE-based project?
The csspin_workflows.stdworkflows plugin provides a “preflight”-workflow, which
executes all spin tasks decorated by “test” and “cept”. The task “pytest” of the
spin_python.pytest plugin for example is decorated by “test”. The “cypress”
task of spin_frontend.cypress as well as the “behave” task from
spin_python.behave are decorated by “cept”.
spinfile.yaml configuration for running the preflight workflowplugin_packages:
- csspin-ce
- csspin-workflows
- csspin-frontend
- csspin-python
plugins:
- csspin_workflows.stdworkflows
- spin_frontend.cypress
- spin_python:
- pytest
- behave
python:
version: "3.11.9"
node:
version: "18.17.1"
cypress:
version: "10.3.0"
...
Assuming the project is provisioned and an sqlite instance is already created, all tasks decorated with “test” and “cept” can be triggered in sequence by calling:
spin preflight
How to run the SBOM workflow?
The sbom workflow triggers SBOM generation, merging, and enrichment by
invoking the sbom:build, sbom:assemble, and sbom:enrich spin tasks
in sequence. Unlike the other workflows, it does not collect tasks via the
@task(when=) decorator but calls named tasks directly.
Run all three steps with a single command:
spin sbom
Each step is also available as a subcommand if only part of the workflow needs to run:
spin sbom build
spin sbom assemble
spin sbom enrich
csspin_workflows.stdworkflows schema reference
- doc: 'any'