Skip to content

Commit 8302c10

Browse files
committed
Refactor package build workflow
* 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
1 parent 0924039 commit 8302c10

File tree

4 files changed

+84
-147
lines changed

4 files changed

+84
-147
lines changed
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: llvmdev_builder
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- .github/workflows/llvmdev_conda_builder.yml
7+
workflow_dispatch:
8+
inputs:
9+
os:
10+
description: "Operating system"
11+
default: "ubuntu-24.04"
12+
required: true
13+
type: choice
14+
options:
15+
- "ubuntu-24.04"
16+
- "macos-14"
17+
- "windows-2019"
18+
recipe:
19+
description: "Recipe to build"
20+
default: "llvmdev"
21+
required: true
22+
type: choice
23+
options:
24+
- "llvmdev"
25+
- "llvmdev_manylinux"
26+
27+
concurrency:
28+
# Concurrency group that uses the workflow name and PR number if available
29+
# or commit SHA as a fallback. If a new build is triggered under that
30+
# concurrency group while a previous build is running it will be canceled.
31+
# Repeated pushes to a PR will cancel all previous builds, while multiple
32+
# merges to master will not cancel.
33+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
34+
cancel-in-progress: true
35+
36+
jobs:
37+
38+
windows:
39+
runs-on: ${{ matrix.os }}
40+
defaults:
41+
run:
42+
shell: bash -el {0}
43+
strategy:
44+
matrix:
45+
os: [ubuntu-24.04,macos-14,windows-2019]
46+
recipe: ${{ github.event_name == 'workflow_dispatch' && [github.event.inputs.recipe] || ['llvmdev', 'llvmdev_manylinux'] }}
47+
48+
steps:
49+
- name: Clone repository
50+
uses: actions/checkout@v4
51+
52+
- name: Setup Miniconda
53+
uses: conda-incubator/setup-miniconda@v3
54+
with:
55+
auto-update-conda: true
56+
auto-activate-base: true
57+
activate-environment: ""
58+
59+
- name: Install conda-build
60+
run: |
61+
conda install conda-build
62+
63+
- name: Build conda package
64+
env:
65+
CONDA_CHANNEL_DIR: conda_channel_dir
66+
run: |
67+
mkdir $CONDA_CHANNEL_DIR
68+
conda build ./conda-recipes/${{ matrix.recipe }} --output-folder=$CONDA_CHANNEL_DIR
69+
ls -lah $CONDA_CHANNEL_DIR
70+
71+
- name: Upload conda package
72+
uses: actions/upload-artifact@v4
73+
with:
74+
name: ${{ matrix.recipe }}-${{ runner.os }}
75+
path: conda_channel_dir
76+
compression-level: 0
77+
retention-days: 7
78+
if-no-files-found: error
79+
run-post: false
80+
81+
- name: Get Workflow Run ID
82+
run: |
83+
echo "Current workflow run ID: ${{ github.run_id }}"
84+
echo "Use this ID when triggering llvmlite workflow"

.github/workflows/llvmdev_linux-64_conda_builder.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

.github/workflows/llvmdev_win-64_conda_builder.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

.github/workflows/llvmdev_win_builder.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)