fix for 2024.4 #124
Workflow file for this run
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: "Python Find Dead Code" | |
on: [pull_request] | |
jobs: | |
lint: | |
name: "Find Dead Code" | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Checkout code" | |
uses: actions/checkout@v3 | |
- run: | | |
echo "package=$(ls -F | grep \/$ | grep -v "bin\|examples\|tests" | sed -n "s/\///g;1p")" >> $GITHUB_ENV | |
- name: "Set up Python" | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- name: "Cache pip" | |
uses: actions/cache@v3 | |
with: | |
# This path is specific to Ubuntu | |
path: ~/.cache/pip | |
# Look to see if there is a cache hit for the corresponding requirements file | |
key: ${{ runner.os }}-pip-${{ hashFiles('requirements*.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
${{ runner.os }}- | |
- name: "Install dependencies" | |
run: | | |
python -m pip install --upgrade pip | |
if [ -f requirements-test.txt ]; then | |
bin/install_requirements requirements-test.txt "${{ secrets.ADMIN_GITHUB_TOKEN }}" | |
elif [ -f requirements-dev.txt ]; then | |
bin/install_requirements requirements-dev.txt "${{ secrets.ADMIN_GITHUB_TOKEN }}" | |
elif [ -f requirements.txt ]; then | |
bin/install_requirements requirements.txt "${{ secrets.ADMIN_GITHUB_TOKEN }}" | |
fi | |
pip install flake8-eradicate | |
if [ -d custom_components ]; then | |
echo '"""Stub."""' >custom_components/__init__.py | |
fi | |
- name: "Lint with flake8 & mypy" | |
run: | | |
flake8 ${{ env.package }} tests | |
mypy --warn-unreachable ${{ env.package }} tests |