-
Notifications
You must be signed in to change notification settings - Fork 8
118 lines (99 loc) · 3.19 KB
/
functional_test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
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"