static analysis #13
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: static analysis | |
on: | |
push: | |
pull_request: | |
# Run every Monday at 6am UTC | |
schedule: | |
- cron: '0 6 * * 1' | |
# execute commands with conda aware shell by default: | |
defaults: | |
run: | |
shell: bash -l {0} | |
jobs: | |
pre-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.x | |
- name: Lint | |
uses: pre-commit/action@v3.0.1 | |
with: | |
extra_args: --all-files --show-diff-on-failure | |
mypy: | |
name: mypy | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Fetch all history for all tags and branches | |
- uses: CagtayFabry/pydeps2env@main | |
with: | |
file: 'pyproject.toml' | |
channels: 'conda-forge defaults' | |
extras: '' | |
setup_requires: 'include' | |
- name: Cache mypy cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
./.mypy_cache | |
key: ${{ runner.os }}-${{ hashFiles('./environment.yml') }} | |
- name: Setup Conda Environment | |
uses: mamba-org/setup-micromamba@v1.8.1 | |
with: | |
environment-file: ./environment.yml | |
environment-name: weldx | |
cache-environment: true | |
create-args: >- | |
python=3.9 | |
mypy | |
- name: activate env | |
run: micromamba activate weldx | |
- name: pip installs | |
run: | | |
python -m pip install -e . | |
- name: Add mypy annotator | |
uses: pr-annotators/mypy-pr-annotator@v1.0.0 | |
- name: run mypy | |
run: | | |
mypy --install-types --non-interactive weldx/ |