From 487116f2303392fdc9fc9b57ffb3ff7240019f95 Mon Sep 17 00:00:00 2001 From: Carlo Russo Date: Fri, 10 Nov 2023 11:13:25 +0100 Subject: [PATCH] Added github action unit test --- .github/workflow/ci_env.yml | 46 +++++++++++++++++++++++++++++++++++++ requirements.txt | 6 ++--- 2 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 .github/workflow/ci_env.yml diff --git a/.github/workflow/ci_env.yml b/.github/workflow/ci_env.yml new file mode 100644 index 0000000..96e116a --- /dev/null +++ b/.github/workflow/ci_env.yml @@ -0,0 +1,46 @@ +name: Lisflood OS Unit Tests + +on: [push] + +jobs: + tests: + runs-on: ubuntu-20.04 + strategy: + max-parallel: 5 + + steps: + - name: Checkout github repo + uses: actions/checkout@v3 + - uses: conda-incubator/setup-miniconda@v2 + with: + auto-update-conda: true + python-version: 3.7 + - name: Conda info + shell: bash -el {0} + run: conda info + - name: Install python and gcc + shell: bash -el {0} + run: | + conda install -c conda-forge python=3.7 + conda install -c conda-forge gcc=12.1.0 + - name: Install gdal eccodes pcraster hdf5 + shell: bash -el {0} + run: | + conda install -c conda-forge gdal==3.5.1 eccodes pcraster + conda install -c conda-forge hdf5 + - name: Install dependencies + shell: bash -el {0} + run: | + pip install -r requirements.txt + pip install . + - name: Check installation + shell: bash -el {0} + run: | + gdal-config --version + python -c "from osgeo import gdal; print(gdal.__version__)" + conda list + - name: Test with pytest + shell: bash -el {0} + run: | + pip install pytest pytest-cov + pytest \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 12d00c9..f1dc6e0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,13 +12,13 @@ lisflood-utilities>=0.12.19 llvmlite>=0.37.0 lxml>=4.6.5 more-itertools>=7.2.0 -netCDF4>=1.5.3 +netCDF4>=1.5.3,<=1.6.4 nine>=1.0.0 numba>=0.54.0 -numexpr>=2.7.0 +numexpr==2.8.1 numpy>=1.21.0 packaging>=19.2 -pandas>=1 +pandas>=1,<2 pathlib2>=2.3.5 pkginfo>=1.5.0.1 pluggy>=0.13.0