summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAndrew Nelson <andyfaff@gmail.com>2022-11-22 08:26:53 +1100
committerAndrew Nelson <andyfaff@gmail.com>2022-11-22 10:22:05 +1100
commit816b73e7a3f9d562fad8d90f630c009d50b26744 (patch)
tree4d6bda0e1b26015e36271a38e2bbdcc57d3afce0 /tools
parent5d32b8d63ab9a376c095f142b86bb55cdfbb95ff (diff)
downloadnumpy-816b73e7a3f9d562fad8d90f630c009d50b26744.tar.gz
CI: initial cirrus config
Diffstat (limited to 'tools')
-rw-r--r--tools/ci/cirrus_general.yml88
1 files changed, 88 insertions, 0 deletions
diff --git a/tools/ci/cirrus_general.yml b/tools/ci/cirrus_general.yml
new file mode 100644
index 000000000..04ce318f1
--- /dev/null
+++ b/tools/ci/cirrus_general.yml
@@ -0,0 +1,88 @@
+build_and_store_wheels: &BUILD_AND_STORE_WHEELS
+ install_cibuildwheel_script:
+ - python -m pip install cibuildwheel==2.11.2
+ cibuildwheel_script:
+ - cibuildwheel
+ wheels_artifacts:
+ path: "wheelhouse/*"
+
+
+######################################################################
+# Build linux_aarch64 natively
+######################################################################
+
+cirrus_wheels_linux_aarch64_task:
+ compute_engine_instance:
+ image_project: cirrus-images
+ image: family/docker-builder-arm64
+ architecture: arm64
+ platform: linux
+ cpu: 4
+ memory: 8G
+ matrix:
+ # build in a matrix because building and testing all four wheels in a
+ # single task takes longer than 60 mins (the default time limit for a
+ # cirrus-ci task).
+ - env:
+ CIBW_BUILD: cp38-*
+ EXPECT_CPU_FEATURES: NEON NEON_FP16 NEON_VFPV4 ASIMD ASIMDHP ASIMDDP ASIMDFHM
+ - env:
+ CIBW_BUILD: cp39-* cp310-*
+ - env:
+ CIBW_BUILD: cp311-*
+
+ build_script: |
+ apt install -y python3-venv python-is-python3 gfortran libatlas-base-dev libgfortran5 eatmydata
+ git fetch origin
+ ./tools/travis-before-install.sh
+ which python
+ echo $CIRRUS_CHANGE_MESSAGE
+ <<: *BUILD_AND_STORE_WHEELS
+
+
+######################################################################
+# Upload all wheels
+######################################################################
+
+cirrus_wheels_upload_task:
+ # Artifacts don't seem to be persistent from task to task.
+ # Rather than upload wheels at the end of each cibuildwheel run we do a
+ # final upload here. This is because a run may be on different OS for
+ # which bash, etc, may not be present.
+ depends_on:
+ - cirrus_wheels_linux_aarch64
+ compute_engine_instance:
+ image_project: cirrus-images
+ image: family/docker-builder
+ platform: linux
+
+# env:
+# # created as SCIPY_STAGING_UPLOAD_TOKEN_CIRRUS and SCIPY_NIGHTLY_UPLOAD_TOKEN_CIRRUS
+# SCIPY_STAGING_UPLOAD_TOKEN: ENCRYPTED[]
+# SCIPY_NIGHTLY_UPLOAD_TOKEN: ENCRYPTED[]
+
+ upload_script: |
+ apt-get install -y python3-venv python-is-python3 curl
+ export IS_SCHEDULE_DISPATCH="false"
+ export IS_PUSH="false"
+
+ # cron job
+ if [[ "$CIRRUS_CRON" == "nightly" ]]; then
+ export IS_SCHEDULE_DISPATCH="true"
+ fi
+
+ # If it's a push event to a maintenance branch, and the commit message contains
+ # '[wheel build]' then upload to staging
+ COMMIT_MSG=$(git log --no-merges -1)
+ if [[ "$COMMIT_MSG" == *"[wheel build]"* ]] && [[ $CIRRUS_BRANCH == maintenance* ]]; then
+ export IS_PUSH="true"
+ fi
+
+ # The name of the zip file is derived from the `wheels_artifact` line.
+ # If you change the artifact line to `myfile_artifact` then it would be
+ # called myfile.zip
+
+ curl https://api.cirrus-ci.com/v1/artifact/build/$CIRRUS_BUILD_ID/wheels.zip --output wheels.zip
+ unzip wheels.zip
+
+ # TODO upload wheels