Skip to content

Commit

Permalink
refactor ci stage
Browse files Browse the repository at this point in the history
  • Loading branch information
rilma committed Oct 27, 2023
1 parent 6dbd267 commit 7d68dc4
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 13 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: pyHWM14 Repository CI Workflow

on:
push:
branches: [ main ]
tags:
- v*.*.*
pull_request:
branches: [ main ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python_version: ["3.10"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python_version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version }}
- name: Install dependencies
run: |
make install
- name: Run code test in Python programs
run: |
make test
20 changes: 7 additions & 13 deletions tests/test.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
#!/usr/bin/env python
from numpy.testing import run_module_suite,assert_allclose
from unittest import TestCase
from pyhwm2014 import HWM14

def test_hwm14():
# Single Height profile
h = HWM14( altlim=[90,200], altstp=1, ap=[-1, 35], day=323,
option=1, ut=11.66667, verbose=False, year=1993 )

assert_allclose([h.Uwind[92],h.Vwind[92]],
[-16.502953,-39.811909])


if __name__ == '__main__':
run_module_suite()
class Test(TestCase):
def test_hwm14(self):
h = HWM14( altlim=[90,200], altstp=1, ap=[-1, 35], day=323,
option=1, ut=11.66667, verbose=False, year=1993 )
self.assertAlmostEqual(h.Uwind[92], -16.502953, places=3)
self.assertAlmostEqual(h.Vwind[92], -39.811909, places=3)

0 comments on commit 7d68dc4

Please sign in to comment.