Skip to content

CI

CI #1889

Workflow file for this run

name: Native Builds
on:
pull_request:
branches: [main]
push:
branches: [main]
release:
types: [published]
schedule:
- cron: '30 20 * * *' # Warning: Timezone dep - 20:00 is 1:00
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
jobs:
prepare-dell:
name: Activate self-host infrastructure
runs-on: [self-hosted, spotter]
steps:
- name: Send Magic Packet
env:
TARGET_IP: 192.168.100.30
MAC_ADDR: a4:bb:6d:51:d5:d2
# The container has no ping, emulate it.
run: |
# Mask the IP and potential broadcast to keep logs clean
echo "::add-mask::$MAC_ADDR"
echo "::add-mask::$BROADCAST"
echo "::add-mask::$TARGET_IP"
BROADCAST=$(echo $TARGET_IP | sed 's/\.[0-9]*$/ .255/' | tr -d ' ')
PING="timeout 1 bash -c 'cat < /dev/null > /dev/tcp/$TARGET_IP/22' 2>/dev/null"
# Install tool silently
sudo apt-get update -qq && sudo apt-get install -y -qq wakeonlan > /dev/null
# Check if already awake (using the Bash TCP PING variable)
if eval "$PING"; then
echo "Target machine is already awake. Exiting."
exit 0
fi
# If offline, send WoL
echo "Machine is offline. Sending WoL..."
wakeonlan -i $BROADCAST $MAC_ADDR > /dev/null
# Wait & Verify Loop (checks every 10s for 4 minutes)
echo "Waiting for response (checking Port 22)..."
for i in {1..24}; do
if eval "$PING"; then
echo "Machine is online and SSH is ready."
exit 0
fi
sleep 10
done
echo "Error: Target hardware did not respond within the timeout period."
exit 1
build:
needs: prepare-dell
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# Ubuntu Arm Jobs
- name: ubu24-arm-gcc12-clang-repl-21-cppyy
os: ubuntu-24.04-arm
compiler: gcc-12
clang-runtime: '21'
cppyy: On
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
Valgrind: On
python-version: '3.14'
- name: ubu24-arm-gcc12-clang-repl-20-cppyy
os: ubuntu-24.04-arm
compiler: gcc-12
clang-runtime: '20'
cppyy: On
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
python-version: '3.13'
- name: ubu24-arm-gcc12-clang-repl-19-cppyy
os: ubuntu-24.04-arm
compiler: gcc-12
clang-runtime: '19'
cppyy: On
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
python-version: '3.12'
- name: ubu24-arm-gcc14-clang20-cling-cppyy
os: ubuntu-24.04-arm
compiler: gcc-14
clang-runtime: '20'
cling: On
cppyy: On
cling-version: '1.3'
root-llvm-tag: 'cling-llvm20-20260119-01'
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
python-version: '3.14'
# Ubuntu X86 Jobs
- name: selfh-ubu22-x86-gcc12-clang-repl-21-cuda
os: [self-hosted, cuda, heavy]
compiler: gcc-12
clang-runtime: '21'
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
python-version: '3.14'
coverage: true
- name: ubu24-x86-gcc12-clang-repl-21-cppyy
os: ubuntu-24.04
compiler: gcc-12
clang-runtime: '21'
cppyy: On
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
Valgrind: On
python-version: '3.14'
- name: ubu24-x86-gcc12-clang-repl-20-cppyy
os: ubuntu-24.04
compiler: gcc-12
clang-runtime: '20'
cppyy: On
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
python-version: '3.13'
- name: ubu24-x86-gcc12-clang-repl-20-out-of-process
os: ubuntu-24.04
compiler: gcc-12
clang-runtime: '20'
llvm_enable_projects: "clang;compiler-rt"
llvm_targets_to_build: "host;NVPTX"
oop-jit: On
Valgrind: On
python-version: '3.13'
- name: ubu24-x86-gcc12-clang-repl-19-cppyy
os: ubuntu-24.04
compiler: gcc-12
clang-runtime: '19'
cppyy: On
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
python-version: '3.12'
- name: ubu24-x86-gcc14-clang20-cling-cppyy
os: ubuntu-24.04
compiler: gcc-14
clang-runtime: '20'
cling: On
cppyy: On
cling-version: '1.3'
root-llvm-tag: 'cling-llvm20-20260119-01'
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
python-version: '3.14'
# MacOS Arm Jobs
- name: osx26-arm-clang-clang-repl-21-cppyy
os: macos-26
compiler: clang
clang-runtime: '21'
cppyy: On
llvm_enable_projects: "clang"
llvm_targets_to_build: "host"
python-version: '3.14'
- name: osx26-arm-clang-clang-repl-20-out-of-process
os: macos-26
compiler: clang
clang-runtime: '20'
llvm_enable_projects: "clang;compiler-rt"
llvm_targets_to_build: "host"
oop-jit: On
python-version: '3.13'
- name: osx26-arm-clang-clang-repl-20-cppyy
os: macos-26
compiler: clang
clang-runtime: '20'
cppyy: On
llvm_enable_projects: "clang"
llvm_targets_to_build: "host"
python-version: '3.13'
- name: osx26-arm-clang-clang-repl-19-cppyy
os: macos-26
compiler: clang
clang-runtime: '19'
cppyy: On
llvm_enable_projects: "clang"
llvm_targets_to_build: "host"
python-version: '3.12'
- name: osx26-arm-clang-clang20-cling-cppyy
os: macos-26
compiler: clang
clang-runtime: '20'
cling: On
cppyy: On
cling-version: '1.3'
root-llvm-tag: 'cling-llvm20-20260119-01'
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
python-version: '3.14'
# MacOS X86 Jobs
- name: osx15-x86-clang-clang-repl-21-cppyy
os: macos-15-intel
compiler: clang
clang-runtime: '21'
cppyy: On
llvm_enable_projects: "clang"
llvm_targets_to_build: "host"
python-version: '3.14'
- name: osx15-x86-clang-clang-repl-20-cppyy
os: macos-15-intel
compiler: clang
clang-runtime: '20'
cppyy: On
llvm_enable_projects: "clang"
llvm_targets_to_build: "host"
python-version: '3.13'
- name: osx15-x86-clang-clang-repl-19-cppyy
os: macos-15-intel
compiler: clang
clang-runtime: '19'
cppyy: On
llvm_enable_projects: "clang"
llvm_targets_to_build: "host"
python-version: '3.12'
- name: osx15-x86-clang-clang20-cling-cppyy
os: macos-15-intel
compiler: clang
clang-runtime: '20'
cling: On
cppyy: On
cling-version: '1.3'
root-llvm-tag: 'cling-llvm20-20260119-01'
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
python-version: '3.14'
# Windows Arm Jobs
- name: win11-msvc-clang-repl-21
os: windows-11-arm
compiler: msvc
clang-runtime: '21'
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
python-version: '3.14'
- name: win11-msvc-clang20-cling
os: windows-11-arm
compiler: msvc
clang-runtime: '20'
cling: On
cling-version: '1.3'
root-llvm-tag: 'cling-llvm20-20260119-01'
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
python-version: '3.14'
# Windows X86 Jobs
- name: win2025-msvc-clang-repl-21
os: windows-2025
compiler: msvc
clang-runtime: '21'
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
python-version: '3.14'
- name: win2025-msvc-clang20-cling
os: windows-2025
compiler: msvc
clang-runtime: '20'
cling: On
cling-version: '1.3'
root-llvm-tag: 'cling-llvm20-20260119-01'
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
python-version: '3.14'
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Save PR Info
uses: ./.github/actions/Miscellaneous/Save_PR_Info
- name: Restore cached LLVM-${{ matrix.clang-runtime }} and ${{ matrix.cling == 'On' && 'Cling' || 'Clang-REPL' }} build
if: ${{ runner.environment != 'self-hosted' }}
uses: actions/cache/restore@v4
id: cache
with:
path: |
llvm-project
${{ matrix.cling=='On' && 'cling' || '' }}
key: ${{ env.CLING_HASH }}-${{ runner.os }}-${{ matrix.os }}-${{ matrix.compiler }}-clang-${{ matrix.clang-runtime }}-${{ matrix.root-llvm-tag || 'none' }}.x-patch-${{ hashFiles(format('patches/llvm/clang{0}-*.patch', matrix.clang-runtime)) || 'none' }}${{ matrix.oop-jit == 'On' && '-oop' || '' }}
- name: Setup default Build Type
uses: ./.github/actions/Miscellaneous/Select_Default_Build_Type
- name: Setup compiler
uses: ./.github/actions/Miscellaneous/Setup_Compiler
- name: Install dependencies
uses: ./.github/actions/Miscellaneous/Install_Dependencies
- name: Install LLVM-${{ matrix.clang-runtime }} dependencies on self-hosted
if: ${{ runner.environment == 'self-hosted' }}
shell: bash
run: |
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
codename="$(. /etc/os-release && echo $UBUNTU_CODENAME)"
echo "deb http://apt.llvm.org/${codename}/ llvm-toolchain-${codename}-${{ matrix.clang-runtime }} main" | sudo tee /etc/apt/sources.list.d/llvm.list
sudo apt-get update
sudo apt-get install -y llvm-${{ matrix.clang-runtime }}-dev libclang-${{ matrix.clang-runtime }}-dev clang-${{ matrix.clang-runtime }} libpolly-${{ matrix.clang-runtime }}-dev libzstd-dev
- name: Build LLVM-${{ matrix.clang-runtime }} and ${{ matrix.cling == 'On' && 'Cling' || 'Clang-REPL' }}
if: ${{ runner.environment != 'self-hosted' }}
uses: ./.github/actions/Build_LLVM
with:
cache-hit: ${{ steps.cache.outputs.cache-hit }}
- name: Cache LLVM-${{ matrix.clang-runtime }} and ${{ matrix.cling == 'On' && 'Cling' || 'Clang-REPL' }} build
uses: actions/cache/save@v4
if: ${{ runner.environment != 'self-hosted' && steps.cache.outputs.cache-hit != 'true' }}
with:
path: |
llvm-project
${{ matrix.cling=='On' && 'cling' || '' }}
key: ${{ steps.cache.outputs.cache-primary-key }}
- name: Setup code coverage
if: ${{ success() && (matrix.coverage == true) }}
run: |
sudo apt-get install -y lcov
echo "CODE_COVERAGE=1" >> $GITHUB_ENV
echo "BUILD_TYPE=Debug" >> $GITHUB_ENV
- name: Build and test CppInterOp
uses: ./.github/actions/Build_and_Test_CppInterOp
- name: Prepare code coverage report
if: ${{ success() && (matrix.coverage == true) }}
run: |
# Create lcov report
# capture coverage info
vers="${CC#*-}"
lcov --directory build/ --capture --output-file coverage.info --gcov-tool /usr/bin/gcov-${vers}
lcov --remove coverage.info '/usr/*' ${{ github.workspace }}'/llvm-project/*' --ignore-errors unused --output-file coverage.info
lcov --remove coverage.info '${{ github.workspace }}/unittests/*' --ignore-errors unused --output-file coverage.info
lcov --remove coverage.info '${{ github.workspace }}/build/*' --ignore-errors unused --output-file coverage.info
# output coverage data for debugging (optional)
lcov --list coverage.info
rm -rf ./build/
- name: Upload to codecov.io
if: ${{ success() && (matrix.coverage == true) }}
uses: codecov/codecov-action@v5
with:
files: ./coverage.info
fail_ci_if_error: true
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
- name: Build and test cppyy
uses: ./.github/actions/Build_and_Test_cppyy
- name: Show debug info
if: ${{ failure() }}
run: |
export
echo $GITHUB_ENV
- name: Setup tmate session
if: ${{ failure() && runner.debug }}
uses: mxschmitt/action-tmate@v3
# When debugging increase to a suitable value!
timeout-minutes: 30