forked from SciTools/iris-esmf-regrid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.cirrus.yml
177 lines (165 loc) · 5.18 KB
/
.cirrus.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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# Reference:
# - https://cirrus-ci.org/guide/writing-tasks/
# - https://cirrus-ci.org/guide/linux/
# - https://cirrus-ci.org/guide/macOS/
# - https://cirrus-ci.org/guide/windows/
# - https://hub.docker.com/_/gcc/
# - https://hub.docker.com/_/python/
#
# Global defaults.
#
container:
image: python:3.8
env:
# Maximum cache period (in weeks) before forcing a new cache upload.
CACHE_PERIOD: "2"
# Increment the build number to force new conda cache upload.
CONDA_CACHE_BUILD: "0"
# Increment the build number to force new nox cache upload.
NOX_CACHE_BUILD: "0"
# Increment the build number to force new pip cache upload.
PIP_CACHE_BUILD: "0"
# Pip package to be upgraded/installed.
PIP_CACHE_PACKAGES: "pip setuptools wheel nox"
#
# Linting
#
lint_task:
auto_cancellation: true
name: "Lint: flake8"
pip_cache:
folder: ~/.cache/pip
fingerprint_script:
- echo "${CIRRUS_OS} py${PYTHON_VERSION}"
- echo "$(date +%Y).$(($(date +%U) / ${CACHE_PERIOD})):${PIP_CACHE_BUILD} ${PIP_CACHE_PACKAGES}"
lint_script:
- pip list
- python -m pip install --retries 3 --upgrade ${PIP_CACHE_PACKAGES}
- pip list
- nox --session lint
#
# Formatting
#
style_task:
auto_cancellation: true
name: "Format: black"
pip_cache:
folder: ~/.cache/pip
fingerprint_script:
- echo "${CIRRUS_OS} py${PYTHON_VERSION}"
- echo "$(date +%Y).$(($(date +%U) / ${CACHE_PERIOD})):${PIP_CACHE_BUILD} ${PIP_CACHE_PACKAGES}"
style_script:
- pip list
- python -m pip install --retries 3 --upgrade ${PIP_CACHE_PACKAGES}
- pip list
- nox --session style
#
# Testing (Linux)
#
linux_task:
auto_cancellation: true
matrix:
env:
PY_VER: "3.6"
env:
PY_VER: "3.7"
env:
PY_VER: "3.8"
COVERAGE: "pytest-cov codecov"
name: "Linux: py${PY_VER}"
container:
image: gcc:latest
env:
PATH: ${HOME}/miniconda/bin:${PATH}
CODECOV_TOKEN: "ENCRYPTED\
[1ed538b97a8d005bdd5ab729de009ac38a2b53389edb0912\
d2e76f5ce1e71c5f7bdea80a79492b57af54691c8936bdc7]"
conda_cache:
folder: ${HOME}/miniconda
fingerprint_script:
- wget --quiet https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
- echo "${CIRRUS_OS} $(sha256sum miniconda.sh)"
- echo "$(date +%Y).$(($(date +%U) / ${CACHE_PERIOD})):${CONDA_CACHE_BUILD}"
populate_script:
- bash miniconda.sh -b -p ${HOME}/miniconda
- conda config --set always_yes yes --set changeps1 no
- conda config --set show_channel_urls True
- conda config --add channels conda-forge
- conda update --quiet --name base conda
- conda install --quiet --name base nox pip
check_script:
- conda info --all
- conda list --name base
- conda list --name base --explicit
nox_cache:
folder: ${CIRRUS_WORKING_DIR}/.nox
fingerprint_script:
- echo "${CIRRUS_OS} tests ${PY_VER}"
- echo "$(date +%Y).$(($(date +%U) / ${CACHE_PERIOD})):${NOX_CACHE_BUILD}"
- cat ${CIRRUS_WORKING_DIR}/requirements/py$(echo ${PY_VER} | tr -d ".").yml
- if [ -n "${COVERAGE}" ]; then echo "${COVERAGE}"; fi
test_script:
- nox --session tests
#
# Testing (macOS)
#
osx_task:
auto_cancellation: true
matrix:
env:
PY_VER: "3.8"
name: "OSX: py${PY_VER}"
osx_instance:
image: catalina-xcode
env:
PATH: ${HOME}/miniconda/bin:${PATH}
conda_cache:
folder: ${HOME}/miniconda
fingerprint_script:
- wget --quiet https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh
- echo "${CIRRUS_OS} $(shasum -a 256 miniconda.sh)"
- echo "$(date +%Y).$(($(date +%U) / ${CACHE_PERIOD})):${CONDA_CACHE_BUILD}"
populate_script:
- bash miniconda.sh -b -p ${HOME}/miniconda
- conda config --set always_yes yes --set changeps1 no
- conda config --set show_channel_urls True
- conda config --add channels conda-forge
- conda update --quiet --name base conda
- conda install --quiet --name base nox pip
check_script:
- conda info --all
- conda list --name base
- conda list --name base --explicit
nox_cache:
folder: ${CIRRUS_WORKING_DIR}/.nox
fingerprint_script:
- echo "${CIRRUS_OS} tests ${PY_VER}"
- echo "$(date +%Y).$(($(date +%U) / ${CACHE_PERIOD})):${NOX_CACHE_BUILD}"
- cat ${CIRRUS_WORKING_DIR}/requirements/py$(echo ${PY_VER} | tr -d ".").yml
test_script:
- nox --session tests
#
# esmpy is unavailable from conda-forge for win
#
# windows_task:
# auto_cancellation: true
# matrix:
# env:
# PY_VER: "3.8"
# name: "Windows: py${PY_VER}"
# windows_container:
# image: cirrusci/windowsservercore:2019
# env:
# ANACONDA_LOCATION: $USERPROFILE\anaconda
# PATH: $ANACONDA_LOCATION\Scripts;$ANACONDA_LOCATION;$PATH
# PYTHON_ARCH: 64
# install_script:
# - choco install -y openssl.light
# - choco install -y miniconda3 --params="'/D:%ANACONDA_LOCATION%'"
# conda_script:
# - conda config --set always_yes yes --set changeps1 no
# - conda config --set show_channel_urls True
# - conda config --add channels conda-forge
# - conda install --quiet --name base nox pip
# test_script:
# - nox --session tests