Skip to content

Commit

Permalink
add action to run pytests (#1167)
Browse files Browse the repository at this point in the history
This PR adds a github action that runs pytests on the python code within pygw.
The package is tested with python versions 3.7,. 3.8, 3.9 and 3.10.
After this PR, tests will be required with every new feature added to `pygw`.
  • Loading branch information
aerorahul authored Dec 9, 2022
1 parent ce05e20 commit c59c0d8
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/pytests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Run pytests
on: [push, pull_request]

jobs:
run_pytests:
runs-on: ubuntu-latest
name: Install pygw and run tests with pytests
strategy:
matrix:
python: ["3.7", "3.8", "3.9", "3.10"]

steps:
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python }}

- name: Install (upgrade) dependencies
run: |
pip install --upgrade pip
- name: Checkout
uses: actions/checkout@v2
with:
path: global-workflow

- name: Install pygw
run: |
cd $GITHUB_WORKSPACE/global-workflow/ush/python/pygw
pip install .[dev]
- name: Run pytests
run: |
cd $GITHUB_WORKSPACE/global-workflow/ush/python/pygw
pytest -v src/tests

0 comments on commit c59c0d8

Please sign in to comment.