This repository has been archived by the owner on Jul 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
.cirrus.yml
98 lines (91 loc) · 3.15 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
# Reference:
# - https://cirrus-ci.org/guide/writing-tasks/
# - https://cirrus-ci.org/guide/tips-and-tricks/#sharing-configuration-between-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
cpu: 2
memory: 4G
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: "2"
# 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"
# Base directory for the iris-test-data.
IRIS_TEST_DATA_DIR: ${HOME}/iris-test-data
#
# Linting
#
lint_task:
auto_cancellation: true
name: "${CIRRUS_OS}: flake8 and black"
pip_cache:
folder: ~/.cache/pip
fingerprint_script:
- echo "${CIRRUS_TASK_NAME}"
- echo "$(date +%Y).$(expr $(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 flake8
- nox --session black
#
# Testing (Linux)
#
linux_task:
auto_cancellation: true
matrix:
env:
PY_VER: 3.7
name: "${CIRRUS_OS}: py${PY_VER} tests"
container:
image: gcc:latest
cpu: 6
memory: 8G
env:
PATH: ${HOME}/miniconda/bin:${PATH}
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).$(expr $(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
nox_cache:
folder: ${CIRRUS_WORKING_DIR}/.nox
fingerprint_script:
- echo "${CIRRUS_TASK_NAME}"
- echo "$(date +%Y).$(expr $(date +%U) / ${CACHE_PERIOD}):${NOX_CACHE_BUILD}"
- cat ${CIRRUS_WORKING_DIR}/requirements/manual/iris_commit.txt
- sha256sum ${CIRRUS_WORKING_DIR}/requirements/ci/py$(echo ${PY_VER} | tr -d ".").yml
data_cache:
folder: ${IRIS_TEST_DATA_DIR}
fingerprint_script:
- cat ${CIRRUS_WORKING_DIR}/requirements/manual/iris_test_data_ref.txt
populate_script:
- export IRIS_TEST_DATA_REF=$(cat ${CIRRUS_WORKING_DIR}/requirements/manual/iris_test_data_ref.txt)
- wget --quiet https://github.com/SciTools/iris-test-data/archive/${IRIS_TEST_DATA_REF}.zip -O iris-test-data.zip
- unzip -q iris-test-data.zip
- mv iris-test-data-${IRIS_TEST_DATA_REF} ${IRIS_TEST_DATA_DIR}
tests_script:
- nox --session tests