Skip to content

Commit

Permalink
Refactor package build workflow
Browse files Browse the repository at this point in the history
* Merge llvmdev_win_builder.yml + llvmdev_win-64_conda_builder.yml into one
  to avoid code duplication
* Add input parameter to be able to select between recipes to build
* Rename flow to llvmdev_conda_builder.yml as it contains nothing specific
  to windows and the code is just a generic conda package builder
* Add ${{ matrix.recipe }}-${{ runner.os }} to upload name to better
  differentiate artifacts
* Remove "x" from `bash -elx {0}` as that pollutes the Action log due to
  the implicit `source "$CONDA/etc/profile.d/conda.sh` calls in every
  step.
* Set `run-post: false` to avoid setup-miniconda cleaning up the Github
  Action VM as that is wiped after the run anyways
* Run the flow if it gets changed in PRs, to see a public verfication
  that the changes are actually working
  • Loading branch information
dbast committed Feb 4, 2025
1 parent 0924039 commit db0de23
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 147 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/llvmdev_conda_builder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: llvmdev_builder

on:
pull_request:
paths:
- .github/workflows/llvmdev_conda_builder.yml
workflow_dispatch:

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 || github.sha }}
cancel-in-progress: true

jobs:

windows:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -el {0}
strategy:
matrix:
os: [ubuntu-24.04,ubuntu-24.04-arm,macos-13,macos-14,windows-2019]
recipe: ['llvmdev', 'llvmdev_manylinux']

steps:
- name: Clone repository
uses: actions/checkout@v4

- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
auto-activate-base: true
activate-environment: ""

- name: Install conda-build
run: |
conda install conda-build
- name: Build conda package
env:
CONDA_CHANNEL_DIR: conda_channel_dir
run: |
mkdir $CONDA_CHANNEL_DIR
conda build ./conda-recipes/${{ matrix.recipe }} --output-folder=$CONDA_CHANNEL_DIR
ls -lah $CONDA_CHANNEL_DIR
- name: Upload conda package
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.recipe }}-${{ runner.os }}
path: conda_channel_dir
compression-level: 0
retention-days: 7
if-no-files-found: error
run-post: false

- name: Get Workflow Run ID
run: |
echo "Current workflow run ID: ${{ github.run_id }}"
echo "Use this ID when triggering llvmlite workflow"
49 changes: 0 additions & 49 deletions .github/workflows/llvmdev_linux-64_conda_builder.yml

This file was deleted.

49 changes: 0 additions & 49 deletions .github/workflows/llvmdev_win-64_conda_builder.yml

This file was deleted.

49 changes: 0 additions & 49 deletions .github/workflows/llvmdev_win_builder.yml

This file was deleted.

0 comments on commit db0de23

Please sign in to comment.