-
Notifications
You must be signed in to change notification settings - Fork 35
migrate travis-ci to cirrus-ci #66
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
Merged
lbdreyer
merged 4 commits into
SciTools:master
from
bjlittle:migrate-travis-ci-to-cirrus-ci
Jun 10, 2021
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| # Reference: | ||
| # - https://cirrus-ci.org/guide/writing-tasks/ | ||
| # - https://cirrus-ci.org/guide/linux/ | ||
| # - https://hub.docker.com/_/gcc/ | ||
| # - https://hub.docker.com/_/python/ | ||
|
|
||
| # | ||
| # Global defaults. | ||
| # | ||
| container: | ||
| image: python:latest | ||
| 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 mambaforge cache upload. | ||
| MAMBA_CACHE_BUILD: "0" | ||
| # Increment the build number to force new mint cache upload. | ||
| NCTA_CACHE_BUILD: "0" | ||
| # Base environment conda packages to be installed | ||
| MAMBA_CACHE_PACKAGES: "pip conda-lock" | ||
| # Increment the build number to forve new pip cache upload. | ||
| PIP_CACHE_BUILD: "0" | ||
| # Linting packages to be installed. | ||
| PIP_CACHE_PACKAGES: "black flake8 isort" | ||
|
|
||
|
|
||
| # | ||
| # Linting | ||
| # | ||
| lint_task: | ||
| auto_cancellation: true | ||
| name: "${CIRRUS_OS}: linting" | ||
| pip_cache: | ||
| folder: ~/.cache/pip | ||
| fingerprint_script: | ||
| - echo "${CIRRUS_TASK_NAME} py${PYTHON_VERSION}" | ||
| - 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 | ||
| - black --check ${CIRRUS_WORKING_DIR} | ||
| - flake8 ${CIRRUS_WORKING_DIR} | ||
| - isort --check ${CIRRUS_WORKING_DIR} | ||
|
|
||
|
|
||
| # | ||
| # Testing (Linux) | ||
| # | ||
| linux_task: | ||
| auto_cancellation: true | ||
| matrix: | ||
| env: | ||
| PY_VER: "3.7" | ||
| env: | ||
| PY_VER: "3.8" | ||
| env: | ||
| PY_VER: "3.9" | ||
| COVERAGE: "codecov" | ||
| name: "${CIRRUS_OS}: py${PY_VER}" | ||
| container: | ||
| image: gcc:latest | ||
| env: | ||
| PATH: ${HOME}/mambaforge/bin:${PATH} | ||
| mamba_cache: | ||
| folder: ${HOME}/mambaforge | ||
| fingerprint_script: | ||
| - wget --quiet https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh -O mambaforge.sh | ||
| - echo "${CIRRUS_OS} $(sha256sum mambaforge.sh)" | ||
| - echo "${MAMBA_CACHE_PACKAGES}" | ||
| - echo "$(date +%Y).$(expr $(date +%U) / ${CACHE_PERIOD}):${MAMBA_CACHE_BUILD}" | ||
| populate_script: | ||
| - bash mambaforge.sh -b -p ${HOME}/mambaforge | ||
| - 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 ${MAMBA_CACHE_PACKAGES} | ||
| check_script: | ||
| - conda info --all | ||
| - conda list --name base | ||
| ncta_cache: | ||
| folder: ${HOME}/mambaforge/envs/py${PY_VER} | ||
| fingerprint_script: | ||
| - echo "${CIRRUS_OS} py${PY_VER} tests" | ||
| - echo "$(date +%Y).$(expr $(date +%U) / ${CACHE_PERIOD}):${NCTA_CACHE_BUILD}" | ||
| - cat ${CIRRUS_WORKING_DIR}/requirements/py$(echo ${PY_VER} | tr -d ".").yml | ||
| populate_script: | ||
| - conda-lock --mamba --platform linux-64 --file ${CIRRUS_WORKING_DIR}/requirements/py$(echo ${PY_VER} | tr -d ".").yml | ||
| - mamba create --name py${PY_VER} --quiet --file conda-linux-64.lock | ||
| - cp conda-linux-64.lock ${HOME}/mambaforge/envs/py${PY_VER} | ||
| test_script: | ||
| - cat ${HOME}/mambaforge/envs/py${PY_VER}/conda-linux-64.lock >&2 | ||
| - source ${HOME}/mambaforge/etc/profile.d/conda.sh >/dev/null 2>&1 | ||
| - conda activate py${PY_VER} >/dev/null 2>&1 | ||
| - pip install --no-deps --editable . | ||
| - pytest --cov-report=xml --cov | ||
| - ${COVERAGE} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| [flake8] | ||
|
|
||
| # References: | ||
| # https://flake8.readthedocs.io/en/latest/user/configuration.html | ||
| # https://flake8.readthedocs.io/en/latest/user/error-codes.html | ||
| # https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes | ||
|
|
||
| select = C,E,F,W,B,B950 | ||
| ignore = | ||
| # E203: whitespace before ':' | ||
| E203, | ||
| # E226: missing whitespace around arithmetic operator | ||
| E226, | ||
| # E231: missing whitespace after ',', ';', or ':' | ||
| E231, | ||
| # E402: module level imports on one line | ||
| E402, | ||
| # E501: line too long | ||
| E501, | ||
| # E731: do not assign a lambda expression, use a def | ||
| E731, | ||
| # W503: line break before binary operator | ||
| W503, | ||
| # W504: line break after binary operator | ||
| W504 | ||
| exclude = | ||
| .eggs | ||
| build | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # See https://pre-commit.com for more information | ||
| # See https://pre-commit.com/hooks.html for more hooks | ||
| repos: | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: 'v4.0.1' | ||
| hooks: | ||
| # Prevent giant files from being committed. | ||
| - id: check-added-large-files | ||
| # Check whether files parse as valid Python. | ||
| - id: check-ast | ||
| # Check for file name conflicts on case-insensitive filesytems. | ||
| - id: check-case-conflict | ||
| # Check for files that contain merge conflict strings. | ||
| - id: check-merge-conflict | ||
| # Check for debugger imports and py37+ `breakpoint()` calls in Python source. | ||
| - id: debug-statements | ||
| # Don't commit to master branch. | ||
| - id: no-commit-to-branch | ||
| - repo: https://github.com/psf/black | ||
| rev: '21.5b2' | ||
| hooks: | ||
| - id: black | ||
| # Force black to run on whole repo, using settings from pyproject.toml | ||
| pass_filenames: false | ||
| args: [--config=./pyproject.toml, .] | ||
| - repo: https://github.com/PyCQA/flake8 | ||
| rev: '3.9.2' | ||
| hooks: | ||
| # Run flake8. | ||
| - id: flake8 | ||
| args: [--config=./.flake8] | ||
| - repo: https://github.com/pycqa/isort | ||
| rev: '5.8.0' | ||
lbdreyer marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| hooks: | ||
| - id: isort | ||
| name: isort | ||
| args: ["--profile", "black", "--filter-files"] | ||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| include LICENSE | ||
| include versioneer.py | ||
| include nc_time_axis/_version.py | ||
|
|
||
| recursive-include nc_time_axis/tests *.py | ||
| graft requirements |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.