diff options
author | Andrew Nelson <andyfaff@gmail.com> | 2022-11-22 08:26:53 +1100 |
---|---|---|
committer | Andrew Nelson <andyfaff@gmail.com> | 2022-11-22 10:22:05 +1100 |
commit | 816b73e7a3f9d562fad8d90f630c009d50b26744 (patch) | |
tree | 4d6bda0e1b26015e36271a38e2bbdcc57d3afce0 /.cirrus.star | |
parent | 5d32b8d63ab9a376c095f142b86bb55cdfbb95ff (diff) | |
download | numpy-816b73e7a3f9d562fad8d90f630c009d50b26744.tar.gz |
CI: initial cirrus config
Diffstat (limited to '.cirrus.star')
-rw-r--r-- | .cirrus.star | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/.cirrus.star b/.cirrus.star new file mode 100644 index 000000000..734a4d51f --- /dev/null +++ b/.cirrus.star @@ -0,0 +1,38 @@ +# The guide to programming cirrus-ci tasks using starlark is found at +# https://cirrus-ci.org/guide/programming-tasks/ +# +# In this simple starlark script we simply check conditions for whether +# a CI run should go ahead. If the conditions are met, then we just +# return the yaml containing the tasks to be run. + +load("cirrus", "env", "fs", "http") + +def main(ctx): + ###################################################################### + # Should wheels be built? + # Only test on the numpy/numpy repository + ###################################################################### + + if env.get("CIRRUS_REPO_FULL_NAME") != "andyfaff/numpy": + return [] + + # if env.get("CIRRUS_CRON", "") == "nightly": + # return fs.read("ci/cirrus_wheels.yml") + + # Obtain commit message for the event. Unfortunately CIRRUS_CHANGE_MESSAGE + # only contains the actual commit message on a non-PR trigger event. + # For a PR event it contains the PR title and description. + SHA = env.get("CIRRUS_CHANGE_IN_REPO") + url = "https://api.github.com/repos/scipy/scipy/git/commits/" + SHA + dct = http.get(url).json() + # if "[wheel build]" in dct["message"]: + # return fs.read("ci/cirrus_wheels.yml") + + if "[skip cirrus]" in dct["message"] or "[skip ci]" in dct["message"]: + return [] + + config = fs.read("tools/ci/cirrus_general.yml") + + # add extra jobs to the cirrus run by += adding to config + + return config |