|
| 1 | +name: pixie_conda_builder |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + pull_request: |
| 8 | + paths: |
| 9 | + - .github/workflows/build_and_upload.yml |
| 10 | + - buildscripts/conda_recipes/pixie/** |
| 11 | + workflow_dispatch: |
| 12 | + inputs: |
| 13 | + platform: |
| 14 | + description: Conda Platform |
| 15 | + default: linux-64 |
| 16 | + required: true |
| 17 | + type: choice |
| 18 | + options: |
| 19 | + - all |
| 20 | + - linux-64 |
| 21 | + |
| 22 | +# Add concurrency control |
| 23 | +concurrency: |
| 24 | + group: >- |
| 25 | + ${{ github.workflow }}- |
| 26 | + ${{ (github.event_name == 'push' && github.ref) |
| 27 | + || github.event.pull_request.number |
| 28 | + || toJson(github.event.inputs) |
| 29 | + || github.sha }} |
| 30 | + cancel-in-progress: true |
| 31 | + |
| 32 | +env: |
| 33 | + ARTIFACT_RETENTION_DAYS: 7 |
| 34 | + |
| 35 | +jobs: |
| 36 | + build: |
| 37 | + name: ${{ matrix.platform }}-py${{ matrix.python-version }}-build |
| 38 | + runs-on: ${{ matrix.runner }} |
| 39 | + env: |
| 40 | + EXTRA_CHANNELS: 'conda-forge' |
| 41 | + defaults: |
| 42 | + run: |
| 43 | + shell: bash -elx {0} |
| 44 | + strategy: |
| 45 | + matrix: |
| 46 | + python-version: ["3.12"] |
| 47 | + platform: ["linux-64"] |
| 48 | + runner: ["ubuntu-24.04"] |
| 49 | + channel: ["conda-forge"] |
| 50 | + fail-fast: false |
| 51 | + |
| 52 | + steps: |
| 53 | + - name: Clone repository |
| 54 | + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 55 | + with: |
| 56 | + fetch-depth: 0 |
| 57 | + |
| 58 | + - name: Setup Miniconda |
| 59 | + uses: conda-incubator/setup-miniconda@835234971496cad1653abb28a638a281cf32541f # v3.2.0 |
| 60 | + with: |
| 61 | + auto-update-conda: true |
| 62 | + auto-activate-base: true |
| 63 | + |
| 64 | + - name: Install conda-build |
| 65 | + run: conda install conda-build |
| 66 | + |
| 67 | + - name: Build pixie conda package |
| 68 | + run: | |
| 69 | + MLIR_CHANNEL=${{ matrix.channel }} |
| 70 | + CONDA_CHANNEL_DIR="conda_channel_dir" |
| 71 | + mkdir $CONDA_CHANNEL_DIR |
| 72 | + if [ -n "${EXTRA_CHANNELS}" ]; then |
| 73 | + extra_args=(${EXTRA_CHANNELS}) |
| 74 | + else |
| 75 | + extra_args=() |
| 76 | + fi |
| 77 | + conda build --debug -c "${MLIR_CHANNEL}" -c defaults --python=${{ matrix.python-version }} buildscripts/conda_recipes/pixie --output-folder="${CONDA_CHANNEL_DIR}" --no-test |
| 78 | +
|
| 79 | + - name: Upload pixie conda package |
| 80 | + uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 |
| 81 | + with: |
| 82 | + name: pixie-${{ matrix.platform }}-py${{ matrix.python-version }} |
| 83 | + path: conda_channel_dir |
| 84 | + compression-level: 0 |
| 85 | + retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }} |
| 86 | + if-no-files-found: error |
| 87 | + |
| 88 | + - name: Show Workflow Run ID |
| 89 | + run: "echo \"Workflow Run ID: ${{ github.run_id }}\"" |
0 commit comments