perf: autobump bio/unicycler/environment.yaml #8943
Workflow file for this run
This file contains hidden or 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: Code quality | |
| on: | |
| pull_request: | |
| paths-ignore: | |
| - 'CHANGELOG.md' | |
| jobs: | |
| formatting: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup mamba | |
| uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| activate-environment: fmt | |
| channels: "conda-forge, bioconda" | |
| miniforge-version: latest | |
| - name: Setup environment | |
| shell: bash -el {0} | |
| run: | | |
| conda config --set channel_priority strict | |
| conda install -n fmt -y black snakefmt | |
| - name: Fetch master | |
| run: | | |
| git fetch origin master | |
| - name: Check Python formatting | |
| shell: bash -el {0} | |
| run: | | |
| black --check */*/*/wrapper.py */*/wrapper.py | |
| - name: Check Snakemake formatting | |
| shell: bash -el {0} | |
| run: | | |
| snakefmt --check $(git diff origin/master --name-only | grep Snakefile) | |
| linting: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup mamba | |
| uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| activate-environment: snakemake | |
| channels: "conda-forge, bioconda" | |
| miniforge-version: latest | |
| - name: Setup Snakemake environment | |
| shell: bash -el {0} | |
| run: | | |
| conda config --set channel_priority strict | |
| conda install -n snakemake -y snakemake snakemake-minimal snakemake-storage-plugin-http | |
| - name: Fetch master | |
| run: | | |
| git fetch origin master | |
| - name: Linting | |
| shell: bash -el {0} | |
| run: | | |
| declare -i ERRORS=0 | |
| # get all modified and added files, not those that are deleted | |
| for f in $(git diff origin/master --name-only --diff-filter=d | grep -P "(test/Snakefile|meta_wrapper.smk)") | |
| do | |
| # lint meta_wrapper.smk and test/Snakefile of normal wrappers | |
| if [[ $f == meta/**/meta_wrapper.smk ]] | |
| then | |
| echo "Linting $f" | |
| # ignore errors in meta_wrapper.smk files for now | |
| # TODO We have to rather lint test/Snakefile because it defines the right pathvars | |
| # or we disable the pathvar checking when linting | |
| (cd $(dirname $f) && (snakemake --lint --snakefile $(basename $f)) || true) | |
| ERRORS+=$? | |
| elif [[ $f != meta/**/test/Snakefile ]] | |
| then | |
| echo "Linting $f" | |
| (cd $(dirname $f) && snakemake --lint --snakefile $(basename $f)) | |
| ERRORS+=$? | |
| fi | |
| done | |
| if (( $ERRORS > 0 )) | |
| then | |
| echo "There are some lints above. Please fix them." | |
| exit 1 | |
| fi |