Enable linter snakemke in snakemkae CI - enforece snakemake qulaity #109
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Snakemake CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
python-version: ["3.11.2"] | |
poetry-version: ["1.8.3"] | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
# Run Super-Linter only on Snakefile and .smk files | |
- name: Lint Snakefiles Only | |
uses: github/super-linter/slim@v5 | |
env: | |
VALIDATE_SNAKEMAKE_SNAKEFMT: true | |
FILTER_REGEX_INCLUDE: '(^Snakefile$|.*\.smk$)' # Only include Snakefile and .smk files | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
DISABLE_ERRORS: true | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: "pip" | |
- uses: mamba-org/setup-micromamba@v1 | |
with: | |
micromamba-version: '1.5.6-0' | |
environment-file: environment.yml | |
init-shell: >- | |
bash | |
cache-environment: true | |
post-cleanup: 'all' | |
- name: Install dependencies | |
run: | | |
pip install -e . | |
pip install pytest | |
pip install snakefmt==0.10.2 | |
- name: Snakemake Linting | |
run: | | |
snakefmt workflow/ | |
- name: Snakemake Testing | |
run: | | |
pytest workflow/.tests | |