Skip to content
Merged
Changes from 3 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
77 changes: 77 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Linux x86_64

on:
push:
branches: [master, main]
pull_request:

env:
CMAKE_BUILD_PARALLEL_LEVEL: 4

jobs:
build-and-test:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-24.04
llvm: 20
python: "3.12"
runtime_cxx_standard: 17
- os: ubuntu-24.04
llvm: 21
python: "3.14"
runtime_cxx_standard: 20

runs-on: ${{ matrix.os }}
name: LLVM ${{ matrix.llvm }} / Python ${{ matrix.python }} / C++${{ matrix.runtime_cxx_standard }}
permissions:
pull-requests: write

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

- name: Install LLVM ${{ matrix.llvm }}
run: |
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo gpg --dearmor -o /usr/share/keyrings/llvm-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/llvm-archive-keyring.gpg] http://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs)-${{ matrix.llvm }} main" \
| sudo tee /etc/apt/sources.list.d/llvm.list
sudo apt-get update
sudo apt-get install -y \
llvm-${{ matrix.llvm }}-dev \
libclang-${{ matrix.llvm }}-dev \
clang-${{ matrix.llvm }} \
libpolly-${{ matrix.llvm }}-dev \
libboost-dev libeigen3-dev
sudo apt-get install -y python${{ matrix.python }}-dev || true

- name: pip install CppJIT
run: |
pip install pytest numba numpy psutil
pip install . -v \
--config-settings=cmake.define.LLVM_DIR=/usr/lib/llvm-${{ matrix.llvm }}/lib/cmake/llvm
env:
CMAKE_BUILD_PARALLEL_LEVEL: "4"

- name: Build test dictionaries
run: make -j4
working-directory: test

- name: Run tests
run: python -m pytest -ra --tb=short -q 2>&1 | tee ../test-output.txt
working-directory: test
env:
CPPINTEROP_EXTRA_INTERPRETER_ARGS: "-std=c++${{ matrix.runtime_cxx_standard }}"

- name: Post results to PR
if: always() && github.event_name == 'pull_request'
run: |
summary=$(tail -1 test-output.txt)
gh pr comment ${{ github.event.pull_request.number }} \
--body "**LLVM ${{ matrix.llvm }} / Python ${{ matrix.python }} / C++${{ matrix.runtime_cxx_standard }}**: \`${summary}\`"
env:
GH_TOKEN: ${{ github.token }}
Loading