Skip to content

Commit

Permalink
cirrus-ci compute credits
Browse files Browse the repository at this point in the history
  • Loading branch information
bjlittle committed Feb 14, 2021
1 parent b2cef91 commit b30e00f
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 19 deletions.
52 changes: 33 additions & 19 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Reference:
# - https://cirrus-ci.org/guide/writing-tasks/
# - https://cirrus-ci.org/guide/writing-tasks/#environment-variables
# - https://cirrus-ci.org/guide/tips-and-tricks/#sharing-configuration-between-tasks
# - https://cirrus-ci.org/guide/linux/
# - https://cirrus-ci.org/guide/macOS/
Expand Down Expand Up @@ -35,25 +36,6 @@ env:
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).$(($(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


#
# YAML alias for common linux test infra-structure.
#
Expand Down Expand Up @@ -89,10 +71,38 @@ linux_task_template: &LINUX_TASK_TEMPLATE
- sha256sum ${CIRRUS_WORKING_DIR}/requirements/ci/py$(echo ${PY_VER} | tr -d ".").yml


#
# YAML alias for compute credits
#
compute_credits_template: &CREDITS_TEMPLATE
# Only use credits for non-DRAFT pull-requests to SciTools/iris master branch by collaborators
use_compute_credits: $CIRRUS_REPO_FULL_NAME == 'SciTools/iris' && $CIRRUS_USER_COLLABORATOR == 'true' && $CIRRUS_PR_DRAFT == 'false' && $CIRRUS_BASE_BRANCH == 'master' && $CIRRUS_PR != ''

#
# Linting
#
lint_task:
<< : *CREDITS_TEMPLATE
auto_cancellation: true
name: "${CIRRUS_OS}: flake8 and black"
pip_cache:
folder: ~/.cache/pip
fingerprint_script:
- echo "${CIRRUS_TASK_NAME}"
- 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 flake8
- nox --session black


#
# Testing Minimal (Linux)
#
linux_minimal_task:
<< : *CREDITS_TEMPLATE
matrix:
env:
PY_VER: 3.6
Expand All @@ -116,6 +126,7 @@ linux_minimal_task:
# Testing Full (Linux)
#
linux_task:
<< : *CREDITS_TEMPLATE
matrix:
env:
PY_VER: 3.6
Expand Down Expand Up @@ -148,6 +159,7 @@ linux_task:
# Testing Documentation Gallery (Linux)
#
gallery_task:
<< : *CREDITS_TEMPLATE
matrix:
env:
PY_VER: 3.8
Expand Down Expand Up @@ -176,6 +188,7 @@ gallery_task:
# Testing Documentation (Linux)
#
doctest_task:
<< : *CREDITS_TEMPLATE
matrix:
env:
PY_VER: 3.8
Expand Down Expand Up @@ -210,6 +223,7 @@ doctest_task:
# Testing Documentation Link Check (Linux)
#
link_task:
<< : *CREDITS_TEMPLATE
matrix:
env:
PY_VER: 3.8
Expand Down
3 changes: 3 additions & 0 deletions docs/src/whatsnew/latest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ This document explains the changes made to Iris for this release
each ``nox`` session to list its ``conda`` environment packages and
environment info. (:pull:`3990`)

#. `@bjlittle`_ enabled `cirrus-ci`_ compute credits for non-draft pull-requests
from collaborators targeting the Iris ``master`` branch. (:pull:`4007`)


.. comment
Whatsnew author names (@github name) in alphabetical order. Note that,
Expand Down

0 comments on commit b30e00f

Please sign in to comment.