[pre-commit.ci] auto fixes from pre-commit.com hooks #1614
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: Continuous Integration - Quality & Unit Tests | |
on: [push, pull_request] | |
jobs: | |
continuous-integration-quality-unit-tests: | |
name: ${{ matrix.os }} - Python ${{ matrix.python-version }} | |
strategy: | |
matrix: | |
os: [macOS-latest, ubuntu-22.04, windows-latest] | |
python-version: [3.9, "3.10", 3.11, 3.12] | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Environment Variables | |
run: | | |
echo "CI_PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV | |
echo "CI_PACKAGE=colour" >> $GITHUB_ENV | |
echo "CI_SHA=${{ github.sha }}" >> $GITHUB_ENV | |
echo "COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_REPO_TOKEN }}" >> $GITHUB_ENV | |
echo "MPLBACKEND=AGG" >> $GITHUB_ENV | |
shell: bash | |
- name: Set up Python 3.9 for Pre-Commit | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Dependencies (Ubuntu) | |
if: matrix.os == 'ubuntu-22.04' | |
run: | | |
sudo apt-get update | |
sudo apt-get --yes install graphviz graphviz-dev libboost-all-dev libilmbase-dev libopenexr-dev libpng-dev libtiff5-dev | |
- name: Install Poetry | |
env: | |
POETRY_VERSION: 1.4.0 | |
run: | | |
curl -sSL https://install.python-poetry.org | POETRY_HOME=$HOME/.poetry python3 - | |
echo "$HOME/.poetry/bin" >> $GITHUB_PATH | |
shell: bash | |
- name: Install Package Dependencies (Ubuntu) | |
if: matrix.os == 'ubuntu-22.04' | |
run: | | |
poetry run python -m pip install --upgrade pip | |
poetry install | |
poetry run python -c "import imageio;imageio.plugins.freeimage.download()" | |
shell: bash | |
- name: Install Package Dependencies (macOS & Windows) | |
if: matrix.os == 'macOS-latest' || matrix.os == 'windows-latest' | |
run: | | |
poetry run python -m pip install --upgrade pip | |
poetry install --without graphviz | |
poetry run python -c "import imageio;imageio.plugins.freeimage.download()" | |
shell: bash | |
- name: Install OpenImageIO (macOs) | |
if: matrix.os == 'macOS-latest' && matrix.python-version == '3.11' | |
run: | | |
brew install openimageio | |
ls /usr/local/Cellar/openimageio/*/lib/python*/site-packages/OpenImageIO/ | |
ln -s /usr/local/Cellar/openimageio/*/lib/python*/site-packages/OpenImageIO/OpenImageIO*.so /Library/Frameworks/Python.framework/Versions/${{ matrix.python-version }}/lib/python${{ matrix.python-version }}/site-packages/OpenImageIO.so | |
shell: bash | |
- name: Pre-Commit (All Files) | |
run: | | |
poetry run pre-commit run --all-files | |
shell: bash | |
- name: Test Optimised Python Execution | |
run: | | |
poetry run python -OO -c "import $CI_PACKAGE" | |
shell: bash | |
- name: Test with Pytest | |
run: | | |
poetry run python -W ignore -m pytest --doctest-modules --ignore=$CI_PACKAGE/examples --cov=$CI_PACKAGE $CI_PACKAGE | |
shell: bash | |
- name: Upload Coverage to coveralls.io | |
if: matrix.os == 'macOS-latest' && matrix.python-version == '3.11' | |
run: | | |
if [ -z "$COVERALLS_REPO_TOKEN" ]; then echo \"COVERALLS_REPO_TOKEN\" secret is undefined!; else poetry run coveralls; fi | |
shell: bash |