mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-26 11:08:13 +00:00
ci/windows: install osm2pgsql binary and enable full unit tests suite
This commit is contained in:
@@ -11,6 +11,18 @@ runs:
|
|||||||
using: "composite"
|
using: "composite"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Set up PostgreSQL variables
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
$version = "${{ inputs.postgresql-version }}"
|
||||||
|
$root = "C:\Program Files\PostgreSQL\$version"
|
||||||
|
$bin = "$root\bin"
|
||||||
|
|
||||||
|
echo "PGROOT=$root" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
|
echo "PGBIN=$bin" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
|
|
||||||
|
echo "$bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||||
|
|
||||||
- name: Decide Postgis version (Windows)
|
- name: Decide Postgis version (Windows)
|
||||||
id: postgis-ver
|
id: postgis-ver
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
@@ -36,19 +48,19 @@ runs:
|
|||||||
key: postgis-cache-${{ steps.postgis-ver.outputs.postgis_file }}
|
key: postgis-cache-${{ steps.postgis-ver.outputs.postgis_file }}
|
||||||
|
|
||||||
- name: Download postgis
|
- name: Download postgis
|
||||||
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
if (!(Test-Path "C:\postgis.zip")){(new-object net.webclient).DownloadFile($env:PGIS_BUNDLE_URL, "c:\postgis.zip")}
|
if (!(Test-Path "C:\postgis.zip")){(new-object net.webclient).DownloadFile($env:PGIS_BUNDLE_URL, "c:\postgis.zip")}
|
||||||
if (Test-path "c:\postgis_archive"){Remove-Item "c:\postgis_archive" -Recurse -Force}
|
if (Test-path "c:\postgis_archive"){Remove-Item "c:\postgis_archive" -Recurse -Force}
|
||||||
7z x c:\postgis.zip -oc:\postgis_archive
|
7z x c:\postgis.zip -oc:\postgis_archive
|
||||||
shell: pwsh
|
|
||||||
env:
|
env:
|
||||||
PGIS_BUNDLE_URL: ${{ steps.postgis-ver.outputs.postgis_bundle_url }}
|
PGIS_BUNDLE_URL: ${{ steps.postgis-ver.outputs.postgis_bundle_url }}
|
||||||
|
|
||||||
- name: Install postgis
|
- name: Install postgis
|
||||||
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
echo "Root: $PGROOT, Bin: $PGBIN"
|
echo "Root: $PGROOT, Bin: $PGBIN"
|
||||||
cp -r c:/postgis_archive/postgis-bundle-*/* "$PGROOT"
|
cp -r c:/postgis_archive/postgis-bundle-*/* "$PGROOT"
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Start PostgreSQL on Windows
|
- name: Start PostgreSQL on Windows
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
44
.github/workflows/ci-tests-windows.yml
vendored
44
.github/workflows/ci-tests-windows.yml
vendored
@@ -1,44 +0,0 @@
|
|||||||
name: CI Tests (Windows)
|
|
||||||
|
|
||||||
on: [ push, pull_request ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
tests:
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
flavour: ["windows-latest"]
|
|
||||||
include:
|
|
||||||
- flavour: windows-latest
|
|
||||||
runner: windows-latest
|
|
||||||
python: '3.11'
|
|
||||||
|
|
||||||
runs-on: ${{ matrix.runner }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
submodules: true
|
|
||||||
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python }}
|
|
||||||
cache: pip
|
|
||||||
|
|
||||||
- name: Install test prerequisites
|
|
||||||
run: |
|
|
||||||
python -m pip install -U pip
|
|
||||||
python -m pip install \
|
|
||||||
pytest pytest-asyncio \
|
|
||||||
"psycopg[binary]!=3.3.0" \
|
|
||||||
python-dotenv pyyaml jinja2 psutil sqlalchemy
|
|
||||||
|
|
||||||
- name: Python unit tests (Windows subset)
|
|
||||||
run: |
|
|
||||||
python -m pytest \
|
|
||||||
test/python/utils \
|
|
||||||
test/python/config \
|
|
||||||
test/python/api/test_api_types.py \
|
|
||||||
test/python/api/search/test_query.py \
|
|
||||||
test/python/api/query_processing/test_regex_replace.py \
|
|
||||||
test/python/api/query_processing/test_split_japanese_phrases.py
|
|
||||||
26
.github/workflows/ci-tests.yml
vendored
26
.github/workflows/ci-tests.yml
vendored
@@ -154,7 +154,7 @@ jobs:
|
|||||||
|
|
||||||
- uses: ./Nominatim/.github/actions/setup-postgresql-windows
|
- uses: ./Nominatim/.github/actions/setup-postgresql-windows
|
||||||
with:
|
with:
|
||||||
postgresql-version: 18
|
postgresql-version: 17
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
@@ -167,6 +167,19 @@ jobs:
|
|||||||
7z x spatialite.7z -o"C:\spatialite"
|
7z x spatialite.7z -o"C:\spatialite"
|
||||||
echo "C:\spatialite\mod_spatialite-5.1.0-win-amd64" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
echo "C:\spatialite\mod_spatialite-5.1.0-win-amd64" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||||
|
|
||||||
|
- name: Install osm2pgsql
|
||||||
|
run: |
|
||||||
|
Invoke-WebRequest -Uri "https://osm2pgsql.org/download/windows/osm2pgsql-latest-x64.zip" -OutFile "osm2pgsql.zip"
|
||||||
|
Expand-Archive -Path "osm2pgsql.zip" -DestinationPath "C:\osm2pgsql"
|
||||||
|
$BinDir = Get-ChildItem -Path "C:\osm2pgsql" -Recurse -Filter "osm2pgsql.exe" | Select-Object -ExpandProperty DirectoryName | Select-Object -First 1
|
||||||
|
if (-not $BinDir) {
|
||||||
|
Write-Error "Could not find osm2pgsql.exe"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
echo "$BinDir" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||||
|
$FullExePath = Join-Path $BinDir "osm2pgsql.exe"
|
||||||
|
echo "NOMINATIM_OSM2PGSQL_BINARY=$FullExePath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
|
|
||||||
- name: Set UTF-8 encoding
|
- name: Set UTF-8 encoding
|
||||||
run: |
|
run: |
|
||||||
echo "PYTHONUTF8=1" >> $env:GITHUB_ENV
|
echo "PYTHONUTF8=1" >> $env:GITHUB_ENV
|
||||||
@@ -181,16 +194,9 @@ jobs:
|
|||||||
python -m pip install -U pip
|
python -m pip install -U pip
|
||||||
python -m pip install pytest pytest-asyncio "psycopg[binary]!=3.3.0" python-dotenv pyyaml jinja2 psutil sqlalchemy pytest-bdd falcon starlette uvicorn asgi_lifespan aiosqlite osmium mwparserfromhell
|
python -m pip install pytest pytest-asyncio "psycopg[binary]!=3.3.0" python-dotenv pyyaml jinja2 psutil sqlalchemy pytest-bdd falcon starlette uvicorn asgi_lifespan aiosqlite osmium mwparserfromhell
|
||||||
|
|
||||||
- name: Python unit tests (subset)
|
- name: Python unit tests
|
||||||
run: |
|
run: |
|
||||||
python -m pytest test/python `
|
python -m pytest test/python -k "not (import_osm or run_osm2pgsql)"
|
||||||
--ignore=test/python/tools/test_add_osm_data.py `
|
|
||||||
--ignore=test/python/tools/test_database_import.py `
|
|
||||||
--ignore=test/python/tools/test_exec_utils.py `
|
|
||||||
--ignore=test/python/cli/test_cmd_import.py `
|
|
||||||
--ignore=test/python/data/test_country_info.py `
|
|
||||||
--ignore=test/python/db/test_utils.py `
|
|
||||||
--ignore=test/python/tools/test_refresh.py
|
|
||||||
working-directory: Nominatim
|
working-directory: Nominatim
|
||||||
|
|
||||||
install:
|
install:
|
||||||
|
|||||||
34
.github/workflows/windows-ci.yml
vendored
34
.github/workflows/windows-ci.yml
vendored
@@ -1,34 +0,0 @@
|
|||||||
name: Windows CI (experimental)
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
push:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
windows-smoke:
|
|
||||||
runs-on: windows-latest
|
|
||||||
continue-on-error: true #this is a smoke test (experimental); it won't block merges
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
submodules: true
|
|
||||||
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: "3.11"
|
|
||||||
cache: pip
|
|
||||||
cache-dependency-path: |
|
|
||||||
packaging/nominatim-db/pyproject.toml
|
|
||||||
packaging/nominatim-api/pyproject.toml
|
|
||||||
|
|
||||||
- name: Install latest flake8
|
|
||||||
run: python -m pip install -U pip flake8
|
|
||||||
|
|
||||||
- name: Python linting
|
|
||||||
run: python -m flake8 src test/python test/bdd
|
|
||||||
|
|
||||||
- name: Compile Python sources (smoke)
|
|
||||||
run: python -m compileall src/nominatim_db src/nominatim_api nominatim-cli.py
|
|
||||||
Reference in New Issue
Block a user