CI: Test Against Geos Versions #503
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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
workflow_dispatch: | |
# This allows a subsequently queued workflow run to interrupt previous runs. | |
concurrency: | |
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | |
cancel-in-progress: true | |
jobs: | |
Test: | |
strategy: | |
fail-fast: false | |
matrix: | |
ruby: | |
- head | |
- '3.2' | |
- '3.1' | |
- '3.0' | |
- '2.7' | |
- "jruby" | |
os: | |
- ubuntu | |
# Windows users, feel free to open a PR :) | |
# - windows | |
- macos | |
exclude: | |
- os: windows # See issue #242, windows support would be welcome. | |
runs-on: ${{ matrix.os }}-latest | |
continue-on-error: ${{ matrix.ruby == 'head' || matrix.os == 'windows' || matrix.os == 'macos' }} | |
name: Ruby ${{ matrix.ruby }} (${{ matrix.os }}) | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby }} | |
bundler-cache: true | |
- name: Install Geos (Linux) | |
if: matrix.os == 'ubuntu' | |
run: | | |
sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable | |
sudo apt-get install -yqq libgeos-dev | |
- name: Install Geos (Mac) | |
if: matrix.os == 'macos' | |
run: HOMEBREW_NO_INSTALL_CLEANUP=1 brew install geos | |
- name: Install Geos (Windows) | |
if: matrix.os == 'windows' | |
run: TODO | |
- name: Bundle Install | |
run: bundle install | |
- name: Set Maintainer Mode | |
if: ${{ github.event.pull_request }} | |
run: export MAINTAINER_MODE='-Wold-style-definition' | |
- name: Test | |
run: bundle exec rake | |
GeosTest: | |
strategy: | |
fail-fast: false | |
matrix: | |
ruby: | |
- head | |
- '3.2' | |
- '3.1' | |
- '3.0' | |
- '2.7' | |
- "jruby" | |
os: | |
- ubuntu | |
geos: | |
- '3.12.0' | |
- '3.11.2' | |
- '3.10.5' | |
- '3.9.4' | |
- '3.8.3' | |
runs-on: ${{ matrix.os }}-latest | |
continue-on-error: ${{ matrix.ruby == 'head' || matrix.os == 'windows' || matrix.os == 'macos' }} | |
name: Ruby ${{ matrix.ruby }}, Geos ${{ matrix.geos }} (${{ matrix.os }}) | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Packages | |
if: matrix.os == 'ubuntu' | |
run: | | |
sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable | |
sudo apt-get -yqq install curl libcurl4-openssl-dev libssl-dev cmake | |
- uses: actions/cache@v2 | |
id: geos-cache | |
with: | |
path: ./geos-${{ matrix.geos }} | |
key: geos-${{ matrix.geos }}-${{ matrix.os }} | |
- name: Download and Compile Geos | |
if: steps.geos-cache.outputs.cache-hit != 'true' | |
run: | | |
wget -c https://download.osgeo.org/geos/geos-${{ matrix.geos }}.tar.bz2 | |
tar -xf geos-${{ matrix.geos }}.tar.bz2 | |
cd geos-${{ matrix.geos }} | |
mkdir build | |
cd build | |
cmake .. | |
cmake --build . -j2 | |
cd ../../ | |
- name: Install Geos | |
run: | | |
cd geos-${{ matrix.geos }}/build | |
sudo cmake --build . --target install | |
cd ../../ | |
- name: ldconfig | |
if: matrix.os == 'ubuntu' | |
run: sudo ldconfig | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby }} | |
bundler-cache: true | |
- name: Bundle Install | |
run: bundle install | |
- name: Set Maintainer Mode | |
if: ${{ github.event.pull_request }} | |
run: export MAINTAINER_MODE='-Wold-style-definition' | |
- name: Test | |
run: bundle exec rake | |
Memcheck: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.1' | |
bundler-cache: true | |
- name: Install dependencies | |
run: | | |
sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable | |
sudo apt-get install -yqq libgeos-dev valgrind | |
- name: Test & Memcheck | |
run: bundle exec rake test:valgrind | |
RuboCop: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 'head' | |
bundler-cache: true | |
- run: | | |
bundle exec rubocop --color --parallel | |
clang-format: | |
# NOTE: you could update that tag to `-latest` when the new ubuntu LTS | |
# is released. Nowadays, `-latest` would point to 20.04 which has an | |
# outdated clang-format package. | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install clang-format | |
run: sudo apt-get install -yqq clang-format | |
- name: Show version | |
run: clang-format --version | |
- name: Run clang-format | |
run: bin/clang-format lint |