Require Python 3.11 (#578) #466
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: DrawBot Test Bench | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
test: | |
runs-on: macos-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v1 | |
- name: Set up Python 3.12 | |
run: | | |
curl https://www.python.org/ftp/python/3.12.1/python-3.12.1-macos11.pkg --output pythonInstaller.pkg | |
sudo installer -pkg pythonInstaller.pkg -target / | |
# Somehow using plain "python3" gives us the runner's homebrew Python, | |
# so let's be explicit about the path: | |
ourpython=/Library/Frameworks/Python.framework/Versions/3.12/bin/python3.12 | |
ls -l $ourpython | |
$ourpython --version | |
$ourpython -c "import platform; print('platform:', platform.platform())" | |
$ourpython -c "import platform; print('macOS version:', platform.mac_ver()[0])" | |
$ourpython -m venv venv | |
source venv/bin/activate | |
python -c "print('venv')" | |
python -c "import sys; print('\n'.join(sys.path))" | |
python -c "import platform; print('platform:', platform.platform())" | |
python -c "import platform; print('macOS version:', platform.mac_ver()[0])" | |
- name: Install dependencies | |
run: | | |
source venv/bin/activate | |
pip install -r ./test-requirements.txt | |
pip install . | |
pip install codecov | |
- name: Run MyPy on public API | |
run: | | |
source venv/bin/activate | |
mypy --follow-imports=skip drawBot/drawBotDrawingTools.py | |
mypy --follow-imports=skip drawBot/context/baseContext.py | |
mypy --follow-imports=skip drawBot/context/tools/imageObject.py | |
- name: Run tests | |
run: | | |
source venv/bin/activate | |
coverage run ./tests/runAllTests.py | |
- name: Storing Test Data Artifacts | |
if: failure() | |
uses: actions/upload-artifact@master | |
with: | |
name: DrawBot Temp Data Results | |
path: ./tests/tempTestData | |
- name: Building Test Differences | |
if: failure() | |
run: | | |
source venv/bin/activate | |
python ./tests/differenceBuilder.py ./tests/tempTestData ./tests/differences.pdf | |
- name: Storing Test Differences | |
if: failure() | |
uses: actions/upload-artifact@master | |
with: | |
name: DrawBot Test Differences | |
path: ./tests/differences.pdf | |