changing LICENSE to LICENSE.md #2
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 cgp-pygeoapi | |
on: | |
push: | |
branches: | |
- main | |
- master | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
main: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- python-version: '3.10' | |
env: | |
PYGEOAPI_CONFIG: "$(pwd)/pygeoapi-config.yml" | |
steps: | |
- name: Clear up GitHub runner diskspace | |
run: | | |
echo "Space before" | |
df -h / | |
sudo rm -rf /usr/local/lib/android | |
sudo rm -rf /usr/share/dotnet | |
echo "Space after" | |
df -h / | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
name: Setup Python ${{ matrix.python-version }} | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Configure sysctl limits | |
run: | | |
sudo swapoff -a | |
sudo sysctl -w vm.swappiness=1 | |
sudo sysctl -w fs.file-max=262144 | |
sudo sysctl -w vm.max_map_count=262144 | |
- name: Install and run PostgreSQL/PostGIS 📦 | |
uses: huaxk/postgis-action@v1 | |
with: | |
postgresql password: ${{ secrets.DatabasePassword || 'postgres' }} | |
postgresql db: 'test' | |
- name: Install and run Elasticsearch 📦 | |
uses: getong/[email protected] | |
with: | |
elasticsearch version: '8.3.1' | |
host port: 9200 | |
container port: 9200 | |
host node port: 9300 | |
node port: 9300 | |
discovery type: 'single-node' | |
- name: Install and run MongoDB | |
uses: supercharge/[email protected] | |
with: | |
mongodb-version: 4.4 | |
- name: Install and run SensorThingsAPI | |
uses: cgs-earth/[email protected] | |
- name: Install sqlite and gpkg dependencies | |
uses: awalsh128/cache-apt-pkgs-action@latest | |
with: | |
packages: libsqlite3-mod-spatialite | |
version: 4.3.0a-6build1 | |
- name: Use ubuntuGIS unstable ppa | |
run: sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable && sudo apt update | |
shell: bash | |
- name: Install GDAL with Python bindings | |
uses: awalsh128/cache-apt-pkgs-action@latest | |
with: | |
packages: gdal-bin libgdal-dev | |
version: 3.8.4 | |
- name: Install and run Oracle | |
run: | | |
docker run -d --name oracledb -e ORACLE_PWD=oracle -v ${{ github.workspace }}/tests/data/oracle/init-db:/opt/oracle/scripts/startup -p 1521:1521 container-registry.oracle.com/database/express:21.3.0-xe | |
- name: Install requirements | |
run: | | |
pip3 install -r requirements.txt | |
pip3 install -r requirements-admin.txt | |
pip3 install -r requirements-starlette.txt | |
pip3 install -r requirements-dev.txt | |
pip3 install -r requirements-provider.txt | |
pip3 install -r requirements-django.txt | |
pip3 install -r docs/requirements.txt | |
python3 setup.py install | |
pip3 install --upgrade numpy elasticsearch | |
pip3 install --upgrade numpy "sqlalchemy<2" | |
pip3 install --global-option=build_ext --global-option="-I/usr/include/gdal" GDAL==`gdal-config --version` | |
- name: Setup test data | |
run: | | |
python3 tests/load_es_data.py tests/data/ne_110m_populated_places_simple.geojson geonameid | |
python3 tests/load_es_data.py tests/cite/canada-hydat-daily-mean-02HC003.geojson IDENTIFIER | |
python3 tests/load_mongo_data.py tests/data/ne_110m_populated_places_simple.geojson | |
gunzip < tests/data/hotosm_bdi_waterways.sql.gz | psql postgresql://postgres:${{ secrets.DatabasePassword || 'postgres' }}@localhost:5432/test | |
psql postgresql://postgres:${{ secrets.DatabasePassword || 'postgres' }}@localhost:5432/test -f tests/data/dummy_data.sql | |
docker ps | |
python3 tests/load_oracle_data.py | |
- name: run unit tests ⚙️ | |
env: | |
POSTGRESQL_PASSWORD: ${{ secrets.DatabasePassword || 'postgres' }} | |
run: | | |
pytest tests/test_api.py | |
pytest tests/test_api_ogr_provider.py | |
pytest tests/test_config.py | |
pytest tests/test_csv__formatter.py | |
pytest tests/test_csv__provider.py | |
pytest tests/test_django.py | |
pytest tests/test_elasticsearch__provider.py | |
pytest tests/test_esri_provider.py | |
pytest tests/test_filesystem_provider.py | |
pytest tests/test_geojson_provider.py | |
pytest tests/test_mongo_provider.py | |
pytest tests/test_ogr_csv_provider.py | |
pytest tests/test_ogr_esrijson_provider.py | |
pytest tests/test_ogr_gpkg_provider.py | |
pytest tests/test_ogr_shapefile_provider.py | |
pytest tests/test_ogr_sqlite_provider.py | |
pytest tests/test_ogr_wfs_provider.py | |
pytest tests/test_openapi.py | |
pytest tests/test_oracle_provider.py | |
pytest tests/test_postgresql_provider.py | |
pytest tests/test_rasterio_provider.py | |
pytest tests/test_sensorthings_provider.py | |
pytest tests/test_socrata_provider.py | |
pytest tests/test_sqlite_geopackage_provider.py | |
pytest tests/test_tinydb_catalogue_provider.py | |
pytest tests/test_tinydb_manager_for_parallel_requests.py | |
pytest tests/test_util.py | |
pytest tests/test_xarray_netcdf_provider.py | |
pytest tests/test_xarray_zarr_provider.py | |
- name: build docs 🏗️ | |
run: cd docs && make html | |
- name: Set current date as env variable | |
run: echo "NOW=$(date +'%Y%m%d-%H%M')" >> $GITHUB_ENV | |
- name: Upload zip file artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cgp_pygeoapi-${{ env.NOW }} | |
path: ${{ github.workspace }}/* |