forked from NCAS-CMS/cf-python
-
Notifications
You must be signed in to change notification settings - Fork 0
120 lines (106 loc) · 3.85 KB
/
dask-migration-testing.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
119
120
# A GitHub Action to run test_Data.py only for the 'lama-to-dask' branch
name: Test `cf.Data` during the replacement of LAMA with Dask
on:
push:
branches:
- lama-to-dask
pull_request:
types: [opened, reopened, ready_for_review]
branches:
- lama-to-dask
jobs:
test-suite-job-0:
# Set-up the build matrix. We run on different distros and Python versions.
strategy:
matrix:
# Skip older ubuntu-16.04 & macos-10.15 to save usage resource
os: [ubuntu-latest, macos-latest]
python-version: [3.7, 3.8, 3.9]
# Run on new and old(er) versions of the distros we support (Linux, Mac OS)
runs-on: ${{ matrix.os }}
# The sequence of tasks that will be executed as part of this job:
steps:
- name: Checkout cf-python
uses: actions/checkout@v2
with:
path: main
# Provide a notification message
- name: Notify about setup
run: echo Now setting up the environment for the cf-python test suite...
- name: Checkout the current cfdm master to use as the dependency
uses: actions/checkout@v2
with:
repository: NCAS-CMS/cfdm
path: cfdm
# Prepare to run the test-suite on different versions of Python 3:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
# Setup conda, which is the simplest way to access all dependencies,
# especially as some are C-based so otherwise difficult to setup.
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
miniconda-version: 'latest'
activate-environment: cf-latest
python-version: ${{ matrix.python-version }}
channels: ncas, conda-forge
# Ensure shell is configured with conda activated:
- name: Check conda config
shell: bash -l {0}
run: |
conda info
conda list
conda config --show-sources
conda config --show
# Install cf-python dependencies, excluding cfdm, pre-testing
# We do so with conda which was setup in a previous step.
- name: Install dependencies
shell: bash -l {0}
run: |
conda install -c ncas -c conda-forge udunits2=2.2.25
conda install -c conda-forge mpich esmpy
conda install scipy matplotlib dask
pip install pycodestyle
# Install cfdm from master branch, then the cf-python development version
# We do so with conda which was setup in a previous step.
- name: Install development cfdm and cf-python
shell: bash -l {0}
run: |
cd ${{ github.workspace }}/cfdm
pip install -e .
cd ${{ github.workspace }}/main
pip install -e .
# Make UMRead library
- name: Make UMRead
shell: bash -l {0}
run: |
cd ${{ github.workspace }}/main/cf/umread_lib/c-lib
make
# Install the coverage library
# We do so with conda which was setup in a previous step.
- name: Install coverage
shell: bash -l {0}
run: |
conda install coverage
# Provide another notification message
- name: Notify about starting testing
run: echo Setup complete. Now starting to run the cf-python test suite...
# Finally run the relevant tests: firstly test_Data.py...
- name: Run the test_Data test module
shell: bash -l {0}
run: |
cd ${{ github.workspace }}/main/cf/test
python test_Data.py
# ... and finally test_Data_utils.py.
- name: Run the test_Data test module
shell: bash -l {0}
run: |
cd ${{ github.workspace }}/main/cf/test
python test_Data_utils.py
# End with a message indicating the suite has completed its run
- name: Notify about a completed run
run: |
echo The test_Data module has run and you can inspect the results.