Skip to content

[FEATURE] Advanced Mode #146

[FEATURE] Advanced Mode

[FEATURE] Advanced Mode #146

Workflow file for this run

name: Lint
on:
pull_request_target:
concurrency:
group: lint-${{ github.event.pull_request.number }}
cancel-in-progress: true
env:
TZ: Europe/Berlin
defaults:
run:
shell: bash -el {0}
jobs:
auto-lint:
name: Formatting and Style
runs-on: ubuntu-22.04
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.SEQAN_ACTIONS_PAT }}
- name: Setup conda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: lint
auto-activate-base: false
auto-update-conda: false
channels: conda-forge
channel-priority: strict
environment-file: workflow/envs/lint.yml
miniforge-version: latest
use-mamba: true
- name: Run isort
run: isort .
- name: Run black
run: black .
- name: Run snakefmt
run: snakefmt .
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.SEQAN_ACTIONS_GPG_KEY }}
passphrase: ${{ secrets.SEQAN_ACTIONS_GPG_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: Commit changes
id: commit
uses: EndBug/add-and-commit@v9
with:
add: .
author_name: seqan-actions[bot]
author_email: [email protected]
message: '[MISC] automatic linting'
# Wait for new commit to start new workflow run such that this run is cancelled.
# Useful for auto-merge on success of all workflows.
- name: Wait
if: steps.commit.outputs.committed == 'true'
run: sleep 60
# Otherwise, continue.
- name: Run pylint
if: steps.commit.outputs.committed == 'false'
run: pylint .