Build #413
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: Build | |
on: | |
push: | |
pull_request: | |
schedule: | |
- cron: '0 6 * * 1' | |
jobs: | |
build: | |
runs-on: ${{matrix.os}} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
python-version: [3.11] | |
poetry-version: [1.4.2] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Setup Poetry | |
uses: abatilo/actions-poetry@v2.0.0 | |
with: | |
poetry-version: ${{ matrix.poetry-version }} | |
- name: Install System Dependencies (macOS) | |
if: matrix.os == 'macOS-latest' | |
run: | | |
brew install pkg-config | |
brew install libffi | |
brew install cairo | |
brew install pango | |
brew install gdal | |
# https://github.com/Kozea/CairoSVG/issues/354#issuecomment-1160552256 | |
sudo ln -s /opt/homebrew/lib/libcairo* . | |
sudo ln -s /opt/homebrew/lib/libpango* . | |
sudo ln -s /opt/homebrew/lib/libgobject* . | |
sudo ln -s /opt/homebrew/lib/libglib* . | |
- name: Install System Dependencies (ubuntu) | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable | |
sudo apt-get update | |
sudo apt-get install gdal-bin libgdal-dev | |
# Print the gdal version, so we know what the minimum version we can | |
# support in pyproject.toml. Unlike homebrew for macOS, ubuntugis for | |
# Ubuntu seems to be a bit behind the latest version by a few months. | |
- name: GDAL version info (ubuntu) | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
gdal-config --version | |
# Installing autotrace will take up a lot of unnecessary time. | |
# To make things easier for us, we mock the functionality of autotrace. | |
- name: Install System Dependencies Mock (autotrace) | |
run: | | |
ln -s `pwd`/.github/mocks/autotrace.sh /usr/local/bin/autotrace | |
- name: Install dependencies | |
run: | | |
poetry install --with gdal | |
- name: Run linting | |
run: | | |
poetry run flake8 | |
- name: Run tests | |
run: | | |
poetry run pytest |