Skip to content

Commit

Permalink
cirrus-ci compute credits (SciTools#4007)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjlittle committed Mar 1, 2021
1 parent 40c215e commit 8180b56
Showing 1 changed file with 33 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 @@ -114,6 +124,7 @@ linux_minimal_task:
# Testing Full (Linux)
#
linux_task:
<< : *CREDITS_TEMPLATE
matrix:
env:
PY_VER: 3.6
Expand Down Expand Up @@ -144,6 +155,7 @@ linux_task:
# Testing Documentation Gallery (Linux)
#
gallery_task:
<< : *CREDITS_TEMPLATE
matrix:
env:
PY_VER: 3.6
Expand Down Expand Up @@ -174,6 +186,7 @@ gallery_task:
# Testing Documentation (Linux)
#
doctest_task:
<< : *CREDITS_TEMPLATE
matrix:
env:
PY_VER: 3.7
Expand Down Expand Up @@ -208,6 +221,7 @@ doctest_task:
# Testing Documentation Link Check (Linux)
#
link_task:
<< : *CREDITS_TEMPLATE
matrix:
env:
PY_VER: 3.7
Expand Down

0 comments on commit 8180b56

Please sign in to comment.