1.4.1 #51
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 application | |
on: [push] | |
permissions: | |
contents: read | |
jobs: | |
build: | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10"] | |
os: [ | |
"macos-latest", | |
"ubuntu-latest", | |
"windows-latest", | |
] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install flake8 pytest pylint Pillow filetype | |
- name: Install Linux dependencies | |
# https://ubuntuhandbook.org/index.php/2023/03/ffmpeg-6-0-released-how-to-install-in-ubuntu-22-04-20-04/ | |
# sudo add-apt-repository ppa:ubuntuhandbook1/ffmpeg6 | |
if: startsWith(matrix.os, 'ubuntu') | |
run: | | |
sudo apt-get install optipng ffmpeg | |
- name: Install Macos dependencies | |
if: startsWith(matrix.os, 'macos') | |
run: | | |
brew install optipng ffmpeg | |
- name: Install Windows dependencies | |
if: startsWith(matrix.os, 'windows') | |
run: | | |
choco install optipng ffmpeg | |
- name: Show versions | |
run: | | |
ffmpeg -version | |
- name: Lint with flake8 | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
- name: Lint with pylint | |
# C0103: Variable name naming style | |
# C0200: Consider using enumerate instead of iterating with range and len | |
# C0301: line too long | |
# C0325: Unnecessary parens after 'if' keyword | |
# R0912: Too many branches | |
# R0913: Too many arguments | |
# R0914: Too many local variables | |
# R0915: Too many statements | |
# R1705: Unnecessary "else" after "return" | |
# W0511: todo | |
# W0621: Redefining name 'extensionSkipped' from outer scope | |
# W0613: Unused argument | |
# W0702: No exception type(s) specified | |
# W0718: Catching too general exception | |
run: | | |
pylint --indent-string=' ' --disable C0103,C0200,C0301,C0325,R0912,R0913,R0914,R0915,R1705,W0511,W0621,W0613,W0702,W0718 $(git ls-files '*.py') | |
- name: Test with pytest | |
run: | | |
pytest tests/png.py tests/export_to_webp.py tests/mp4.py tests/crop.py |