summaryrefslogtreecommitdiff
path: root/tools/ci/cirrus_general.yml
blob: 2a51f5ba82f31fcd7e2b5302dd10143abdc1bb0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
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-*
    - env:
        CIBW_BUILD: 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:
    NUMPY_STAGING_UPLOAD_TOKEN: ENCRYPTED[!5a69522ae0c2af9edb2bc1cdfeaca6292fb3666d9ecd82dca0615921834a6ce3b702352835d8bde4ea2a9ed5ef8424ac!]
    NUMPY_NIGHTLY_UPLOAD_TOKEN: ENCRYPTED[!196422e6c3419a3b1d79815e1026094a215cb0f346fe34ed0f9d3ca1c19339df7398d04556491b1e0420fc1fe3713289!]

  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 [[ "$CIRRUS_TAG" == "v*" ]]; 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
    
    source ./tools/wheels/upload_wheels.sh
    set_upload_vars
    upload_wheels # Will be skipped if not a push/tag/scheduled build