File: llvmdev_build.yml

package info (click to toggle)
llvmlite 0.46.0-0.1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,140 kB
  • sloc: python: 13,605; cpp: 3,192; makefile: 185; sh: 168
file content (154 lines) | stat: -rw-r--r-- 5,400 bytes parent folder | download
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
name: llvmdev

on:
  pull_request:
    paths:
      - .github/workflows/llvmdev_build.yml
      - buildscripts/github/llvmdev_evaluate.py
      - conda-recipes/llvmdev/**
      - conda-recipes/llvmdev_for_wheel/**
  label:
    types: [created]
  workflow_dispatch:
    inputs:
      platform:
        description: Conda Platform
        default: all
        required: true
        type: choice
        options:
          - all
          - linux-64
          - linux-aarch64
          - osx-arm64
          - win-64
      recipe:
        description: Recipe to build
        default: all
        required: true
        type: choice
        options:
          - all
          - llvmdev
          - llvmdev_for_wheel

concurrency:
  # Concurrency group that uses the workflow name and PR number if available
  # or commit SHA as a fallback. If a new build is triggered under that
  # concurrency group while a previous build is running it will be canceled.
  # Repeated pushes to a PR will cancel all previous builds, while multiple
  # merges to master will not cancel.
  group: >-
    ${{ github.workflow }}-
    ${{ github.event.pull_request.number
      || toJson(github.event.inputs)
      || github.event.label.name
      || github.sha }}
  cancel-in-progress: true

env:
  ARTIFACT_RETENTION_DAYS: 7

jobs:

  check:
    runs-on: ubuntu-24.04
    outputs:
      matrix: ${{ steps.evaluate.outputs.matrix }}
    steps:
      - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
      - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
        with:
          python-version: '3.14'
      - name: Evaluate
        id: evaluate
        env:
          GITHUB_EVENT_NAME: ${{ github.event_name }}
          GITHUB_LABEL_NAME: ${{ github.event.label.name }}
          GITHUB_WORKFLOW_INPUT: ${{ toJson(github.event.inputs) }}
        run: |
          ./buildscripts/github/llvmdev_evaluate.py

  build:
    needs: check
    name: ${{ matrix.recipe }}-${{ matrix.platform }}
    runs-on: ${{ matrix.runner }}
    defaults:
      run:
        shell: bash -el {0}
    strategy:
      matrix: ${{fromJson(needs.check.outputs.matrix)}}
      fail-fast: false

    steps:
      - name: Clone repository
        uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

      - name: Setup Miniconda
        uses: conda-incubator/setup-miniconda@835234971496cad1653abb28a638a281cf32541f # v3.2.0
        with:
          auto-update-conda: true
          auto-activate-base: true
          activate-environment: ''
          run-post: false

      - name: Build and test conda package in manylinux - linux platforms
        if: (matrix.platform == 'linux-64' || matrix.platform == 'linux-aarch64') && matrix.recipe == 'llvmdev_for_wheel'
        env:
          CONDA_CHANNEL_DIR: conda_channel_dir
        run: |
          set -x
          # Set manylinux-specific variables
          MANYLINUX_IMAGE=""
          MINICONDA_FILE=""
          if [[ "${{ matrix.platform }}" == "linux-64" ]]; then
            MANYLINUX_IMAGE="quay.io/pypa/manylinux2014_x86_64"
            MINICONDA_FILE="https://repo.anaconda.com/miniconda/Miniconda3-py311_24.9.2-0-Linux-x86_64.sh"
          elif [[ "${{ matrix.platform }}" == "linux-aarch64" ]]; then
            MANYLINUX_IMAGE="quay.io/pypa/manylinux_2_28_aarch64"
            MINICONDA_FILE="https://repo.anaconda.com/miniconda/Miniconda3-py311_24.9.2-0-Linux-aarch64.sh"
          fi

          echo "Building in manylinux container for ${{ matrix.platform }}"
          mkdir -p docker_output
          docker run --rm \
            -v "$(pwd):/root/llvmlite" \
            "$MANYLINUX_IMAGE" \
            bash -c "git config --global --add safe.directory /root/llvmlite && /root/llvmlite/buildscripts/manylinux/build_llvmdev.sh $MINICONDA_FILE"

          sudo chown -R "$(id -u):$(id -g)" docker_output

          # The script outputs to docker_output/<platform>/*.conda
          # Move the package to the upload directory.
          mkdir -p "${CONDA_CHANNEL_DIR}"
          mv docker_output/*/*.conda "${CONDA_CHANNEL_DIR}/"
          ls -lah "${CONDA_CHANNEL_DIR}"

      - name: Install conda-build
        if: (matrix.platform != 'linux-64' && matrix.platform != 'linux-aarch64') || matrix.recipe != 'llvmdev_for_wheel'
        run: |
          conda install -c defaults conda-build

      - name: Build and test conda package - non-linux platforms
        if: (matrix.platform != 'linux-64' && matrix.platform != 'linux-aarch64') || matrix.recipe != 'llvmdev_for_wheel'
        env:
          CONDA_CHANNEL_DIR: conda_channel_dir
        run: |
          set -x
          mkdir -p "${CONDA_CHANNEL_DIR}"
          conda build -c defaults "./conda-recipes/${{ matrix.recipe }}" "--output-folder=${CONDA_CHANNEL_DIR}"
          ls -lah "${CONDA_CHANNEL_DIR}"

      - name: Upload conda package
        uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
        with:
          name: ${{ matrix.recipe }}_${{ matrix.platform }}
          path: conda_channel_dir
          compression-level: 0
          retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }}
          if-no-files-found: error

      - name: Get Workflow Run ID
        run: |
          echo "Current workflow run ID: ${{ github.run_id }}"
          echo "Use this ID when triggering llvmlite workflow"