forked from NCAR/ccpp-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (52 loc) · 1.78 KB
/
python.yaml
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
name: Python package
on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
#Trigger workflow on push to any branch or branch heirarchy:
- '**'
jobs:
build:
if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' || github.repository == 'NCAR/ccpp-framework' || github.event_name == 'push'
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.9, 3.11]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Test with pytest
run: |
export PYTHONPATH=$(pwd)/scripts:$(pwd)/scripts/parse_tools
pytest
doctest:
if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' || github.repository == 'NCAR/ccpp-framework' || github.event_name == 'push'
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.9, 3.11]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Doctest
run : |
export PYTHONPATH=$(pwd)/scripts:$(pwd)/scripts/parse_tools
pytest scripts/ --doctest-modules