Skip to content

relock on latest develop branches #7

relock on latest develop branches

relock on latest develop branches #7

Workflow file for this run

name: static analysis
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- develop
- main
- release/**
- feature/**
- hotfix/**
push:
branches:
- develop
- main
- release/**
- feature/**
- hotfix/**
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
source_dir: geoapps
jobs:
pylint:
name: pylint
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
env:
PYTHONUTF8: 1
CONDA_CHANNEL_PRIORITY: strict
PIP_NO_DEPS: 1 # all dependencies are installed from conda
CONDA_LOCK_ENV_FILE: environments/py-3.10-linux-64-dev.conda.lock.yml
steps:
- uses: actions/checkout@v4
- name: Setup conda env
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ${{ env.CONDA_LOCK_ENV_FILE }}
environment-name: linter_env
cache-downloads: true
- name: capture modified files
if: github.event_name == 'pull_request'
run: >-
git fetch --deepen=500 origin ${{github.base_ref}}
&& echo "FILES_PARAM=$(
git diff --diff-filter=AM --name-only refs/remotes/origin/${{github.base_ref}}... -- | grep -E "^(${source_dir}|tests)/.*\.py$" | xargs
)" >> $GITHUB_ENV
- name: Run pylint on modified files
if: github.event_name == 'pull_request' && env.FILES_PARAM
run: pylint $FILES_PARAM
- name: Run pylint on all files
if: github.event_name == 'push'
run: pylint $source_dir tests