scipy
/
.cirrus.star
45 строк · 1.9 Кб
1# The guide to programming cirrus-ci tasks using starlark is found at
2# https://cirrus-ci.org/guide/programming-tasks/
3#
4# In this simple starlark script we simply check conditions for whether
5# a CI run should go ahead. If the conditions are met, then we just
6# return the yaml containing the tasks to be run.
7
8load("cirrus", "env", "fs", "http")
9
10def main(ctx):
11######################################################################
12# Should wheels be built?
13# Only test on the scipy/scipy repository
14# Test if the run was triggered by:
15# - a cron job called "nightly". The cron job is not set in this file,
16# but on the cirrus-ci repo page
17# - commit message containing [wheel build]
18######################################################################
19
20if env.get("CIRRUS_REPO_FULL_NAME") != "scipy/scipy":
21return []
22
23if env.get("CIRRUS_CRON", "") == "nightly":
24return fs.read("ci/cirrus_wheels.yml")
25
26# Obtain commit message for the event. Unfortunately CIRRUS_CHANGE_MESSAGE
27# only contains the actual commit message on a non-PR trigger event.
28# For a PR event it contains the PR title and description.
29SHA = env.get("CIRRUS_CHANGE_IN_REPO")
30url = "https://api.github.com/repos/scipy/scipy/git/commits/" + SHA
31dct = http.get(url).json()
32if "[wheel build]" in dct["message"]:
33return fs.read("ci/cirrus_wheels.yml")
34
35# this configuration runs a single linux_aarch64 + macosx_arm64 run.
36# there's no need to do this during a wheel run as they automatically build
37# and test over a wider range of Pythons.
38PR = int(env.get("CIRRUS_PR", -1))
39if PR < 0:
40return []
41
42if "[skip cirrus]" in dct["message"] or "[skip ci]" in dct["message"] or "[lint only]" in dct["message"] or "[docs only]" in dct["message"]:
43return []
44
45return fs.read("ci/cirrus_general_ci.yml")
46