Skip to content

Make MAVFTP more robust on F4 processors #1701

Make MAVFTP more robust on F4 processors

Make MAVFTP more robust on F4 processors #1701

Workflow file for this run

name: mypy
on:
pull_request:
paths:
- '**/*.py' # Watch for changes in any Python files
- 'pyproject.toml' # Watch for changes in the pyproject.toml file
push:
paths:
- '**/*.py' # Watch for changes in any Python files
- 'pyproject.toml' # Watch for changes in the pyproject.toml file
workflow_dispatch:
release:
types: [published]
concurrency:
group: ci-${{github.workflow}}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
mypy:
name: mypy
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Install dependencies
id: install_deps
continue-on-error: true
run: |
WARNINGS=0
export MYPY_VERSION=$(grep -oP 'mypy==\K[0-9]+(\.[0-9]+)*' pyproject.toml || echo '')
export TYPES_REQUESTS_VERSION=$(grep -oP 'types-requests==\K[0-9]+(\.[0-9]+)*' pyproject.toml || echo '')
if [ -z "$MYPY_VERSION" ]; then
echo "::warning::Could not detect mypy version in pyproject.toml; falling back to latest."
MYPY_INSTALL="mypy"
WARNINGS=1
else
echo "Will install mypy version $MYPY_VERSION."
MYPY_INSTALL="mypy==$MYPY_VERSION"
fi
if [ -z "$TYPES_REQUESTS_VERSION" ]; then
echo "::warning::Could not detect types-requests version in pyproject.toml; falling back to latest."
TYPES_REQUESTS_INSTALL="types-requests"
WARNINGS=1
else
echo "Will install types-requests version $TYPES_REQUESTS_VERSION."
TYPES_REQUESTS_INSTALL="types-requests==$TYPES_REQUESTS_VERSION"
fi
python -m pip install "$MYPY_INSTALL" "$TYPES_REQUESTS_INSTALL"
echo "warnings=$WARNINGS" >> $GITHUB_OUTPUT
if [ "$WARNINGS" -eq 1 ]; then
exit 1
fi
- name: Lint the code with mypy
uses: amilcarlucas/mypy-github-action@1c66c3e030d835206f4fda2bbc8b0ed4c8a75769 # v2.0.1
with:
checkName: 'mypy' # NOTE: this needs to be the same as the job name
mypyFlags: ''
mypyFiles: ''
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}