From 864551a37efa460fc2db36c898d7d104c7a53d74 Mon Sep 17 00:00:00 2001 From: sharkAndshark Date: Fri, 11 Oct 2024 15:33:09 +0800 Subject: [PATCH 1/2] Add test on postgis 3.3 to CICD --- .github/workflows/test_on_postgis-3.3.yml | 64 +++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .github/workflows/test_on_postgis-3.3.yml diff --git a/.github/workflows/test_on_postgis-3.3.yml b/.github/workflows/test_on_postgis-3.3.yml new file mode 100644 index 0000000..925ef19 --- /dev/null +++ b/.github/workflows/test_on_postgis-3.3.yml @@ -0,0 +1,64 @@ +name: PostGIS_3.3 + +on: [push, pull_request] + +jobs: + test_on_postgis_33: + runs-on: ubuntu-latest + strategy: + matrix: + dotnet-version: ["2.1.x"] + postgis-version: + [ + "postgis/postgis:11-3.3-alpine", + "postgis/postgis:12-3.3-alpine", + "postgis/postgis:13-3.3-alpine", + "postgis/postgis:14-3.3-alpine", + "postgis/postgis:15-3.3-alpine", + ] + services: + postgis: + image: ${{ matrix.postgis-version }} + env: + POSTGRES_USER: reader + POSTGRES_PASSWORD: reader + POSTGRES_DB: postgistest + ports: + - 5432:5432 + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + + steps: + - name: init database table owm_cities + run: psql -h localhost -p 5432 -d postgistest -U reader -c "CREATE TABLE IF NOT EXISTS owm_cities(id integer primary key, city_name varchar not null, geom geometry not null);" + env: + PGPASSWORD: reader + + - name: init database table test_geometry + run: psql -h localhost -p 5432 -d postgistest -U reader -c "CREATE TABLE test_geometry(id integer primary key, geom geometry);" + env: + PGPASSWORD: reader + + - name: init database table test_geography + run: psql -h localhost -p 5432 -d postgistest -U reader -c "CREATE TABLE test_geography(id integer primary key, geog geography);" + env: + PGPASSWORD: reader + + - name: get source + uses: actions/checkout@v2 + + - name: Setup .NET Core SDK ${{ matrix.dotnet-version }} + uses: actions/setup-dotnet@v1.7.2 + with: + dotnet-version: ${{ matrix.dotnet-version }} + + - name: Install dependencies + run: dotnet restore + + - name: Build + run: dotnet build --configuration Release --no-restore + - name: Test + run: dotnet test --no-restore --verbosity normal From a8abeb41f46614b0fd3b43dc2ea0a923f57f8027 Mon Sep 17 00:00:00 2001 From: sharkAndshark Date: Fri, 11 Oct 2024 16:02:48 +0800 Subject: [PATCH 2/2] Use truncate instead of delete for test setup --- .../AffineTransformationsTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LinqToDBPostGisNetTopologySuite.Tests/AffineTransformationsTests.cs b/LinqToDBPostGisNetTopologySuite.Tests/AffineTransformationsTests.cs index 7f9b50e..86262db 100644 --- a/LinqToDBPostGisNetTopologySuite.Tests/AffineTransformationsTests.cs +++ b/LinqToDBPostGisNetTopologySuite.Tests/AffineTransformationsTests.cs @@ -16,8 +16,8 @@ public void Setup() { using (var db = new PostGisTestDataConnection(TestDatabaseConnectionString)) { - db.TestGeometries.Delete(); - db.TestGeographies.Delete(); + db.TestGeometries.Truncate(); + db.TestGeographies.Truncate(); } }