No explicit header set for the DOWNLOAD_SESSION #483 #573
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 tests | |
on: | |
push: | |
branches: | |
- develop | |
- main | |
pull_request: | |
branches: | |
- develop | |
- main | |
jobs: | |
pre_job: | |
name: Path match check | |
runs-on: ubuntu-latest | |
# Map a step output to a job output | |
outputs: | |
should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
steps: | |
- id: skip_check | |
uses: fkirc/skip-duplicate-actions@master | |
with: | |
github_token: ${{ github.token }} | |
paths: '["**.py", "requirements_test.txt", ".github/workflows/pythontest.yml"]' | |
unit_test: | |
name: Python unit tests | |
needs: pre_job | |
if: ${{ needs.pre_job.outputs.should_skip != 'true' }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
max-parallel: 5 | |
fail-fast: false | |
matrix: | |
os: [windows-latest, ubuntu-latest, macos-13] | |
python-version: [3.8, 3.9, '3.10', '3.11', '3.12'] | |
include: | |
- os: ubuntu-latest | |
pippath: ~/.cache/pip | |
- os: macos-13 | |
pippath: ~/Library/Caches/pip | |
- os: windows-latest | |
pippath: ~\AppData\Local\pip\Cache | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Ubuntu dependencies | |
run: | | |
sudo apt-get -y -qq update | |
sudo apt-get install -y ffmpeg | |
sudo apt-get install -y poppler-utils | |
if: ${{ startsWith(matrix.os, 'ubuntu') }} | |
- name: Cache Mac dependencies | |
uses: actions/cache@v4 | |
if: matrix.os == 'macos-13' | |
with: | |
path: ~/Library/Caches/Homebrew | |
key: ${{ runner.os }}-brew-${{ hashFiles('.github/workflows/pythontest.yml') }} | |
- name: Install Mac dependencies | |
run: brew install ffmpeg poppler | |
if: matrix.os == 'macos-13' | |
- name: Windows dependencies cache | |
id: windowscache | |
if: matrix.os == 'windows-latest' | |
uses: actions/cache@v4 | |
with: | |
path: ${{ github.workspace }}\tools | |
key: ${{ runner.os }}-tools-${{ hashFiles('.github/workflows/pythontest.yml') }} | |
- name: Download and unpack Windows dependencies | |
if: steps.cache.windowscache.cache-hit != 'true' && matrix.os == 'windows-latest' | |
run: | | |
curl --output ffmpeg.zip -L https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-win64-gpl.zip | |
curl --output poppler.zip -L https://github.com/oschwartz10612/poppler-windows/releases/download/v21.11.0-0/Release-21.11.0-0.zip | |
7z x ffmpeg.zip -otools -y | |
7z x poppler.zip -otools -y | |
- name: Set paths to Windows dependencies | |
if: matrix.os == 'windows-latest' | |
run: | | |
echo "$pwd\tools\ffmpeg-master-latest-win64-gpl\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
echo "$pwd\tools\poppler-21.11.0\Library\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
- name: Cache pip | |
if: ${{ !startsWith(runner.os, 'windows') }} | |
uses: actions/cache@v4 | |
with: | |
path: ${{ matrix.pippath }} | |
key: ${{ runner.os }}-pip-py${{ matrix.python-version }}-${{ hashFiles('setup.py') }} | |
- name: Install tox | |
run: | | |
python -m pip install --upgrade pip | |
pip install tox | |
- name: tox env cache | |
if: ${{ !startsWith(runner.os, 'windows') }} | |
uses: actions/cache@v4 | |
with: | |
path: ${{ github.workspace }}/.tox/py${{ matrix.python-version }} | |
key: ${{ runner.os }}-tox-py${{ matrix.python-version }}-${{ hashFiles('setup.py') }} | |
- name: Test with tox | |
run: tox -e py${{ matrix.python-version }} |