Merge pull request #173 from noaa-ocs-modeling/felicio93-patch-2 #433
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: Functional | |
on: | |
push: | |
branches: | |
- 'main' | |
paths: | |
- '**.py' | |
- '.github/workflows/*.yml' | |
- 'pyproject.toml' | |
- 'setup.py' | |
- 'setup.cfg' | |
pull_request: | |
paths: | |
- '**.py' | |
- '.github/workflows/*.yml' | |
- 'pyproject.toml' | |
- 'setup.py' | |
- 'setup.cfg' | |
jobs: | |
basic-functional-tests: | |
name: Python ${{ matrix.python-version }} on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-latest, windows-latest ] | |
python-version: [ '3.9', '3.10', '3.11'] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Mamba environment for Python | |
uses: mamba-org/provision-with-micromamba@main | |
with: | |
environment-file: ./environment.yml | |
environment-name: ocsmesh-env | |
extra-specs: | | |
python=${{ matrix.python-version }} | |
- name: Install other dependencies | |
shell: bash -l {0} | |
run: pip install . | |
- name: Prepare example DEM | |
if: runner.os != 'Windows' | |
shell: bash -l {0} | |
run: | | |
wget https://coast.noaa.gov/htdata/raster2/elevation/NCEI_ninth_Topobathy_2014_8483/northeast_sandy/ncei19_n40x75_w073x75_2015v1.tif -O /tmp/fullsize_dem.tif | |
gdalwarp -tr 0.0005 0.0005 -r average -overwrite /tmp/fullsize_dem.tif /tmp/test_dem.tif | |
- name: Export Conda environment | |
if: runner.os != 'Windows' | |
shell: bash -el {0} | |
run: conda list > environment_py${{ matrix.python-version }}.yml | |
- name: 'Upload conda environment' | |
if: runner.os != 'Windows' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: conda-environment-${{ matrix.python-version }} | |
path: environment_py${{ matrix.python-version }}.yml | |
retention-days: 7 | |
- name: 'Upload test dem' | |
if: runner.os != 'Windows' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-dem-${{ matrix.python-version }} | |
path: /tmp/test_dem.tif | |
retention-days: 7 | |
- name: Run geom build test | |
if: runner.os != 'Windows' | |
shell: bash -l {0} | |
run: source tests/cli/build_geom.sh | |
- name: 'Upload Geom build results' | |
if: runner.os != 'Windows' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: geom-build-results-${{ matrix.python-version }} | |
path: test_shape | |
retention-days: 7 | |
- name: Run hfun build test | |
if: runner.os != 'Windows' | |
shell: bash -l {0} | |
run: source tests/cli/build_hfun.sh | |
- name: 'Upload Hfun build results' | |
if: runner.os != 'Windows' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: hfun-build-results-${{ matrix.python-version }} | |
path: test.2dm | |
retention-days: 7 | |
- name: Run remesh test | |
if: runner.os != 'Windows' | |
shell: bash -l {0} | |
run: source tests/cli/remesh_by_dem.sh | |
- name: 'Upload remesh results' | |
if: runner.os != 'Windows' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: remesh-bydem-results-${{ matrix.python-version }} | |
path: remeshed.2dm | |
retention-days: 7 | |
- name: Run Python API tests | |
shell: bash -el {0} | |
run: python -m unittest discover tests/api -p "*.py" |