Skip to content

Commit 9c4aa34

Browse files
committed
Add GitHub workflow to run Python unit tests.
1 parent 51948b5 commit 9c4aa34

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/python-tests.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Run Python tests
2+
3+
on:
4+
push:
5+
# Run when a change to these files is pushed to any branch. Without the "branches:" line, for some reason this will be run whenever a tag is pushed, even if the listed files aren't changed.
6+
branches: ['*']
7+
paths:
8+
- 'python/**'
9+
- 'cime_config/SystemTests/**'
10+
- 'cime_config/buildlib/**'
11+
- 'cime_config/buildnml/**'
12+
pull_request:
13+
# Run on pull requests that change the listed files
14+
paths:
15+
- 'python/**'
16+
- 'cime_config/SystemTests/**'
17+
- 'cime_config/buildlib/**'
18+
- 'cime_config/buildnml/**'
19+
20+
jobs:
21+
python-unit-tests:
22+
runs-on: ubuntu-latest
23+
steps:
24+
# Checkout the code
25+
- uses: actions/checkout@v4
26+
27+
# Set up the conda environment
28+
- uses: conda-incubator/setup-miniconda@v3
29+
with:
30+
activate-environment: ctsm_pylib
31+
environment-file: python/conda_env_ctsm_py.yml
32+
channels: conda-forge
33+
auto-activate-base: false
34+
35+
# Run Python unit tests check
36+
- name: Run Python unit tests
37+
run: |
38+
cd python
39+
conda run -n ctsm_pylib ./run_ctsm_py_tests -u

0 commit comments

Comments
 (0)