Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add llvmdev and llvmlite build GHA workflows #1122

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
156 changes: 156 additions & 0 deletions .github/workflows/llvmdev_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
name: llvmdev-build

on:
workflow_dispatch:

jobs:
linux-64:
name: Build LLVMDEV (linux-64)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

- name: Install Miniconda
run: |
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
bash miniconda.sh -b -p $HOME/miniconda
echo "$HOME/miniconda/bin" >> $GITHUB_PATH

- name: Setup Conda Environment
run: |
source $HOME/miniconda/bin/activate
conda create -n builder conda-build -y

- name: Build
run: |
source $HOME/miniconda/bin/activate
conda activate builder
RECIPE_NAME=./conda-recipes/llvmdev
conda build $RECIPE_NAME
echo "OUTPUT=$(conda build --output $RECIPE_NAME)" >> $GITHUB_ENV
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this serving a purpose? The OUTPUT variable doesn't appear to be used in any subsequent step, and the command appears to be erroring:

conda: error: argument COMMAND: invalid choice: 'build' (choose from activate, clean, commands, compare, config, create, deactivate, env, export, info, init, install, list, notices, package, content-trust, doctor, repoquery, remove, uninstall, rename, run, search, update, upgrade)

(from https://github.com/swap357/llvmlite/actions/runs/12704394168/job/35413712445#step:3:27279)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, should’ve been removed since build is currently using script


- name: Upload LLVMDEV artifacts
uses: actions/upload-artifact@v4
with:
name: llvmdev-linux-x86_64
path: ${{ env.OUTPUT }}
retention-days: 7
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"

win-64:
name: Build LLVMDEV (win-64)
runs-on: windows-2019
steps:
- uses: actions/checkout@v4

- name: Install Miniconda
shell: pwsh
run: |
$wc = New-Object net.webclient
$wc.Downloadfile("https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe", "Miniconda3-latest-Windows-x86_64.exe")
Start-Process "Miniconda3-latest-Windows-x86_64.exe" "/S /D=C:\Miniconda3" -Wait
# Initialize conda for PowerShell
& C:\Miniconda3\shell\condabin\conda-hook.ps1
conda init powershell

- name: Setup Conda Environment
shell: pwsh
run: |
# Reload the path
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
conda create -n builder conda-build -y

- name: Install Build Dependencies
shell: pwsh
run: |
conda activate builder
conda install -y cmake ninja

- name: Build
shell: pwsh
run: |
conda activate builder

$ErrorActionPreference = 'Stop'
$RecipeName = ".\conda-recipes\llvmdev"

Write-Host "Starting conda build..."
conda build $RecipeName
if ($LASTEXITCODE -ne 0) {
throw "Conda build failed with exit code $LASTEXITCODE"
}

Write-Host "Getting output path..."
$OUTPUT = conda build --output $RecipeName
if ($LASTEXITCODE -ne 0) {
throw "Failed to get conda build output path"
}

Write-Host "Conda package will be at: $OUTPUT"
if (-not (Test-Path $OUTPUT)) {
throw "Expected output package does not exist: $OUTPUT"
}

"OUTPUT=$OUTPUT" | Out-File -FilePath $env:GITHUB_ENV -Append

- name: Upload LLVMDEV artifacts
uses: actions/upload-artifact@v4
with:
name: llvmdev-windows-x86_64
path: ${{ env.OUTPUT }}
retention-days: 7
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"

osx-64:
name: Build LLVMDEV (osx-64)
runs-on: macos-13
steps:
- uses: actions/checkout@v4

- name: Setup Xcode
run: |
sudo xcode-select --switch /Applications/Xcode_14.2.app
xcrun --show-sdk-path

- name: Install Miniconda
run: |
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh
bash miniconda.sh -b -p $HOME/miniconda
echo "$HOME/miniconda/bin" >> $GITHUB_PATH

- name: Setup Conda Environment
run: |
source $HOME/miniconda/bin/activate
conda create -n builder conda-build cmake ninja -y

- name: Build
run: |
source $HOME/miniconda/bin/activate
conda activate builder
RECIPE_NAME=./conda-recipes/llvmdev
conda build $RECIPE_NAME --no-anaconda-upload
echo "OUTPUT=$(conda build --output $RECIPE_NAME)" >> $GITHUB_ENV

- name: Upload LLVMDEV artifacts
uses: actions/upload-artifact@v4
with:
name: llvmdev-osx-64
path: ${{ env.OUTPUT }}
retention-days: 7
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"

27 changes: 27 additions & 0 deletions .github/workflows/llvmdev_manylinux_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: llvmdev-manylinux-build

on:
workflow_dispatch:

jobs:
linux-64:
name: Build LLVMDEV Manylinux (linux-64)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

- name: Build LLVMDEV Manylinux
run: |
mkdir -p /home/runner/work/llvmlite/llvmlite/docker_output
chmod 777 /home/runner/work/llvmlite/llvmlite/docker_output
cd buildscripts/manylinux
./docker_run_x64.sh build_llvmdev.sh "${MINICONDA_FILE}"

- name: Upload LLVMDEV Manylinux artifacts
uses: actions/upload-artifact@v4
with:
name: llvmdev-manylinux-linux-x86_64
path: /home/runner/work/llvmlite/llvmlite/docker_output/linux-64/*.tar.bz2
retention-days: 7
if-no-files-found: error

Loading