Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Test Against Geos Versions #362

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
106e9fc
Test against Geos versions
keithdoggett Aug 24, 2023
057f3cb
fix typo
keithdoggett Aug 24, 2023
12293aa
fix minitest class naming
keithdoggett Aug 24, 2023
5c2f17a
temporarily cut down on build targets
keithdoggett Aug 24, 2023
b277fc4
no sudo on cmake install
keithdoggett Aug 24, 2023
903e10b
update ci
keithdoggett Aug 24, 2023
90284a9
ldconfig after install
keithdoggett Aug 24, 2023
2b6c566
Merge branch 'main' into ci/multiple-geos-versions
keithdoggett Aug 24, 2023
09bb915
add version conditional to test_invalid_polygon_duplicate_rings
keithdoggett Aug 24, 2023
08797ae
fix gem version matching
keithdoggett Aug 24, 2023
b5a5d94
debug
keithdoggett Aug 24, 2023
c771098
move validity tests failing specifically due to geos versions to CAPI…
keithdoggett Aug 24, 2023
60134db
add macos and other ruby versions back to matrix
keithdoggett Aug 24, 2023
832d4bc
ldconfig only on linux
keithdoggett Aug 24, 2023
fae75b4
force reinstall cmake on macos
keithdoggett Aug 24, 2023
78c9947
debug macos build
keithdoggett Aug 24, 2023
2a5d46e
rm debug
keithdoggett Aug 25, 2023
4bb4d96
reinstall cmake
keithdoggett Aug 25, 2023
aab2b28
update brew in macos ci
keithdoggett Aug 28, 2023
e6eaf56
upgrade brew
keithdoggett Aug 28, 2023
fda17d1
upgrade brew
keithdoggett Aug 28, 2023
5863c32
explicitly set GEOS_LIBRARY_PATH on macos jruby builds
keithdoggett Aug 28, 2023
5a15dff
add more debug info
keithdoggett Aug 28, 2023
2f89a31
add yqq flag
keithdoggett Aug 28, 2023
0d2e457
Only test ubuntu against multiple geos versions
keithdoggett Nov 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,70 @@ jobs:
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:
Expand Down
1 change: 1 addition & 0 deletions test/common/validity_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ def test_invalid_polygon_inconsistent_area

def test_invalid_polygon_duplicate_rings
poly = @factory.polygon(big_square, [little_square, little_square])

assert_equal(RGeo::Error::SELF_INTERSECTION, poly.invalid_reason)
assert_equal(false, poly.valid?)
end
Expand Down
11 changes: 11 additions & 0 deletions test/geos_capi/validity_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,15 @@ def test_invalid_polygon_self_intersecting_ring_invalid_reason_location
assert_equal(RGeo::Error::SELF_INTERSECTION, poly.invalid_reason)
assert_equal(false, poly.valid?)
end

def test_invalid_polygon_duplicate_rings
poly = @factory.polygon(big_square, [little_square, little_square])

if geos_version_match(">= 3.10.0")
assert_equal(RGeo::Error::SELF_INTERSECTION, poly.invalid_reason)
else
assert_equal(RGeo::Error::DUPLICATE_RINGS, poly.invalid_reason)
end
assert_equal(false, poly.valid?)
end
end
11 changes: 11 additions & 0 deletions test/geos_ffi/validity_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,15 @@ class GeosFFIValidityTest < Minitest::Test # :nodoc:
def setup
@factory = RGeo::Geos.factory(native_interface: :ffi)
end

def test_invalid_polygon_duplicate_rings
poly = @factory.polygon(big_square, [little_square, little_square])

if geos_version_match(">= 3.10.0")
assert_equal(RGeo::Error::SELF_INTERSECTION, poly.invalid_reason)
else
assert_equal(RGeo::Error::DUPLICATE_RINGS, poly.invalid_reason)
end
assert_equal(false, poly.valid?)
end
end
11 changes: 11 additions & 0 deletions test/simple_mercator/validity_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ def setup
@factory = RGeo::Geographic.simple_mercator_factory
end

def test_invalid_polygon_duplicate_rings
poly = @factory.polygon(big_square, [little_square, little_square])

if geos_version_match(">= 3.10.0")
assert_equal(RGeo::Error::SELF_INTERSECTION, poly.invalid_reason)
else
assert_equal(RGeo::Error::DUPLICATE_RINGS, poly.invalid_reason)
end
assert_equal(false, poly.valid?)
end

# Taken from RGeo::Tests::Common::ValidityTests, but adapted to have a
# correct area.
def square_polygon_expected_area
Expand Down