CI Integration¶
The CLI exits with meaningful codes (0 = clean, 1 = issues, 2 = error), making it easy to wire into automated pipelines.
GitHub Actions¶
Add a validation step to any workflow that touches SampleSheet.csv:
# .github/workflows/validate-samplesheet.yml
name: Validate SampleSheet
on:
push:
paths:
- '**/SampleSheet.csv'
pull_request:
paths:
- '**/SampleSheet.csv'
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: pip install "samplesheet-parser[cli]"
- name: Validate SampleSheet
run: samplesheet validate SampleSheet.csv --format json
pre-commit hook¶
Gate commits that touch any SampleSheet.csv in the repository:
# .pre-commit-config.yaml
repos:
- repo: local
hooks:
- id: samplesheet-validate
name: Validate SampleSheet.csv
entry: samplesheet validate
language: python
additional_dependencies: ["samplesheet-parser[cli]"]
files: SampleSheet\.csv$
pass_filenames: true
Install and run once to verify:
Stricter Hamming distance in CI¶
If your lab uses longer indexes (10 bp+), raise the minimum Hamming distance threshold to catch borderline cases earlier:
Using JSON output in scripts¶
All commands support --format json for machine-readable output: