Files
scst/doc/CI.md
T
Gleb Chesnokov dc506a0474 .github/workflows: Select PR checks by changed paths
Pull requests that only change development guides or independent tooling
still compile kernels and run the VM suites. Select Ginkgo, KUnit, Clang
and kernel regression through one shared path policy before expensive
work. Compare the whole PR against its merge base, retaining deleted
paths and both sides of renames. Run checks for unclassified inputs.

Keep path rules in .github/ci-checks.toml and validate their structure,
check names, literal paths and conflicting entries before selection.
Provide a validation-only command. Changes to the config or selector
exercise every check.

Select kernel regression once in the preparation job and gate the build
job before expanding its matrix. Unrelated PRs do not allocate a runner
for every kernel. Selection failures fail the workflow and successful
skips include a reason in the job summary.

Run the Packages workflow only after pushes to master, preserving its
DEB/RPM builds and publication. Keep the separate Clang DEB build on PRs.
Retain full master and manual checks and the existing Checkpatch runs.
Cover path ownership, config validation and Git histories with tests,
and shorten the CI guide around all workflows, selection and results.

Quote the CC environment key so Checkpatch does not interpret unchanged
YAML diff context as a Cc trailer.
2026-10-19 13:44:33 +03:00

3.9 KiB

Continuous integration

Workflows live in .github/workflows. PR checks target master; push checks run after changes reach master.

Workflow Purpose Events
Checkpatch (PR, push) Patch and commit style PR, push
CI Clang build and DEB packaging PR, push, manual
Packages Ubuntu DEBs, RPMs and a published package snapshot Push to master only
Regression Module and patched-kernel builds across the kernel matrix PR, push
KUnit Kernel unit tests in QEMU PR, push, manual
Ginkgo Local and TCP iSCSI component tests in QEMU PR, push, manual
Coverity Static analysis Push, upstream repository only
Mailing list Commit notifications Push, upstream repository only

On PRs, select_checks.py selects Clang, kernel regression, KUnit and Ginkgo using ci-checks.toml. Edit that config to change path rules; it is validated before selection. Unknown paths and changes to the config or selector run every check. Known unrelated changes skip expensive work; regression selection happens before creating its matrix jobs. Some documentation is a package or kernel-patch input and still needs validation. Checkpatch always runs. Packages runs only after a push to master; the separate Clang build still checks DEB packaging on PRs. Push and manual runs retain their full checks. Selection errors fail the workflow; skip reasons appear in the job summary.

Ginkgo uses ci-pr for PRs, ci-push for master, and all tests for manual runs. See test selection for the label sets. Kernel matrices are maintained through .github/kernel-matrix.conf and nightly/conf/nightly.conf; VM kernel pins are in scripts/ci/kernel.env and kernel.SHA256SUMS and must be updated together.

Results

Start with the failed job's log. KUnit/Ginkgo upload build logs, test reports and serial consoles as artifacts, retained for seven days. Timeouts, guest kernel diagnostics and incomplete reports fail the run. Package artifacts are attached to the Packages workflow; upstream master builds also update the master-rpm prerelease snapshot.

Local reproduction

Use the commands in the relevant workflow for build and package checks; CONTRIBUTING.md describes local entry points. KUnit and Ginkgo describe their standalone runners.

To reproduce the CI VM environment, install Docker with Buildx, fakeroot, tar, mkfs.ext4, Python 3.11+, QEMU with the stream network backend, qemu-img, ssh-keygen and sha256sum. Builds use a committed Git snapshot and matching kernel headers. SCST runs inside disposable guests; host devices are not exported. Use new output directories for each run.

bash scripts/ci/build-image kunit /tmp/scst-kunit-image
python3 scripts/ci/vm.py kunit /tmp/scst-kunit-image /tmp/scst-kunit-results --timeout 1200

bash scripts/ci/build-image ginkgo /tmp/scst-ginkgo-image
python3 scripts/ci/vm.py ginkgo /tmp/scst-ginkgo-image /tmp/scst-ginkgo-results --ginkgo-label ci-pr

Use --ginkgo-label ci-push for the master selection; omit it for all specs. QEMU tries KVM then TCG; --accel tcg forces emulation. To check the VM supervisor itself, use vm.py self-test with a KUnit image; this intentionally crashes a guest.

CI tooling checks without builds or VM access:

python3 scripts/ci/select_checks.py --validate-config
python3 -m unittest discover -s scripts/ci -p 'test_*.py'