Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cirrus-ci compute credits #4007

Merged
merged 1 commit into from
Feb 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 != ''
tkknight marked this conversation as resolved.
Show resolved Hide resolved

#
# 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