Skip to content

Commit 6cc66be

Browse files
authored
Separate out Ubuntu and MacOS builds ci (#408)
1 parent 706b7f4 commit 6cc66be

File tree

3 files changed

+591
-236
lines changed

3 files changed

+591
-236
lines changed

.github/workflows/non-emscripten.yml renamed to .github/workflows/MacOS.yml

Lines changed: 22 additions & 235 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Unix
1+
name: OSX
22

33
on:
44
pull_request:
@@ -22,47 +22,6 @@ jobs:
2222
fail-fast: false
2323
matrix:
2424
include:
25-
- name: ubu22-x86-gcc12-clang-repl-19
26-
os: ubuntu-22.04
27-
compiler: gcc-12
28-
clang-runtime: '19'
29-
cling: Off
30-
cppyy: On
31-
llvm_enable_projects: "clang"
32-
llvm_targets_to_build: "host;NVPTX"
33-
- name: ubu22-x86-gcc12-clang-repl-18
34-
os: ubuntu-22.04
35-
compiler: gcc-12
36-
clang-runtime: '18'
37-
cling: Off
38-
cppyy: On
39-
llvm_enable_projects: "clang"
40-
llvm_targets_to_build: "host;NVPTX"
41-
- name: ubu22-x86-gcc12-clang-repl-17
42-
os: ubuntu-22.04
43-
compiler: gcc-12
44-
clang-runtime: '17'
45-
cling: Off
46-
cppyy: On
47-
llvm_enable_projects: "clang"
48-
llvm_targets_to_build: "host;NVPTX"
49-
- name: ubu22-x86-gcc12-clang-repl-16
50-
os: ubuntu-22.04
51-
compiler: gcc-12
52-
clang-runtime: '16'
53-
cling: Off
54-
cppyy: On
55-
llvm_enable_projects: "clang"
56-
llvm_targets_to_build: "host;NVPTX"
57-
- name: ubu22-x86-gcc9-clang13-cling
58-
os: ubuntu-22.04
59-
compiler: gcc-9
60-
clang-runtime: '13'
61-
cling: On
62-
cling-version: '1.0'
63-
cppyy: On
64-
llvm_enable_projects: "clang"
65-
llvm_targets_to_build: "host;NVPTX"
6625
- name: osx15-arm-clang-clang-repl-19
6726
os: macos-15
6827
compiler: clang
@@ -156,7 +115,7 @@ jobs:
156115
with:
157116
python-version: '3.11'
158117

159-
- name: Save PR Info on Unix systems
118+
- name: Save PR Info
160119
run: |
161120
mkdir -p ./pr
162121
echo ${{ github.event.number }} > ./pr/NR
@@ -186,44 +145,15 @@ jobs:
186145
key: ${{ env.CLING_HASH }}-${{ runner.os }}-${{ matrix.os }}-${{ matrix.compiler }}-clang-${{ matrix.clang-runtime }}.x-patch-${{ hashFiles(format('patches/llvm/clang{0}-*.patch', matrix.clang-runtime)) || 'none' }}
187146
lookup-only: true
188147

189-
- name: Setup default Build Type on *nux
148+
- name: Setup default Build Type
190149
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
191150
run: |
192151
echo "BUILD_TYPE=Release" >> $GITHUB_ENV
193152
echo "CODE_COVERAGE=0" >> $GITHUB_ENV
194-
os="${{ matrix.os }}"
195-
if [[ "${os}" == "macos"* ]]; then
196-
echo "ncpus=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV
197-
else
198-
echo "ncpus=$(nproc --all)" >> $GITHUB_ENV
199-
fi
200-
201-
- name: Setup compiler on Linux
202-
if: ${{ runner.os == 'Linux' && steps.cache.outputs.cache-hit != 'true' }}
203-
run: |
204-
# https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html
205-
vers="${compiler#*-}"
206-
os_codename="`cat /etc/os-release | grep UBUNTU_CODENAME | cut -d = -f 2`"
207-
##sudo apt update
208-
if [[ "${{ matrix.compiler }}" == *"gcc"* ]]; then
209-
sudo apt install -y gcc-${vers} g++-${vers} lld
210-
echo "CC=gcc-${vers}" >> $GITHUB_ENV
211-
echo "CXX=g++-${vers}" >> $GITHUB_ENV
212-
else
213-
if ! sudo apt install -y clang-${vers}; then
214-
curl https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
215-
echo "deb https://apt.llvm.org/${os_codename}/ llvm-toolchain-${os_codename}-${vers} main" | sudo tee -a /etc/apt/sources.list
216-
sudo apt-get update
217-
sudo apt-get install -y clang-${vers}
218-
fi
219-
echo "CC=clang-${vers}" >> $GITHUB_ENV
220-
echo "CXX=clang++-${vers}" >> $GITHUB_ENV
221-
fi
222-
env:
223-
compiler: ${{ matrix.compiler }}
153+
echo "ncpus=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV
224154
225-
- name: Setup compiler on macOS
226-
if: ${{ runner.os == 'macOS' && steps.cache.outputs.cache-hit != 'true' }}
155+
- name: Setup compiler
156+
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
227157
run: |
228158
vers="${compiler#*-}"
229159
if [[ "${{ matrix.compiler }}" == *"gcc"* ]]; then
@@ -259,17 +189,8 @@ jobs:
259189
env:
260190
compiler: ${{ matrix.compiler }}
261191

262-
- name: Install deps on Linux
263-
if: ${{ runner.os == 'Linux' && steps.cache.outputs.cache-hit != 'true' }}
264-
run: |
265-
# Install deps
266-
sudo apt-get update
267-
sudo apt-get install valgrind
268-
sudo apt-get autoremove
269-
sudo apt-get clean
270-
271-
- name: Install deps on MacOS
272-
if: ${{ runner.os == 'macOS' && steps.cache.outputs.cache-hit != 'true' }}
192+
- name: Install deps
193+
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
273194
run: |
274195
brew update
275196
export ARCHITECHURE=$(uname -m)
@@ -286,7 +207,7 @@ jobs:
286207
brew upgrade openssl >/dev/null 2>&1
287208
brew upgrade
288209
289-
- name: Build LLVM/Cling on Unix systems if the cache is invalid
210+
- name: Build LLVM/Cling if the cache is invalid
290211
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
291212
run: |
292213
cling_on=$(echo "${{ matrix.cling }}" | tr '[:lower:]' '[:upper:]')
@@ -378,45 +299,6 @@ jobs:
378299
fail-fast: false
379300
matrix:
380301
include:
381-
- name: ubu22-x86-gcc12-clang-repl-19-docs
382-
os: ubuntu-22.04
383-
compiler: gcc-12
384-
clang-runtime: '19'
385-
cling: Off
386-
cppyy: Off
387-
documentation: On
388-
- name: ubu22-x86-gcc12-clang-repl-19-cppyy
389-
os: ubuntu-22.04
390-
compiler: gcc-12
391-
clang-runtime: '19'
392-
cling: Off
393-
cppyy: On
394-
coverage: true
395-
- name: ubu22-x86-gcc12-clang-repl-18-cppyy
396-
os: ubuntu-22.04
397-
compiler: gcc-12
398-
clang-runtime: '18'
399-
cling: Off
400-
cppyy: On
401-
- name: ubu22-x86-gcc12-clang-repl-17-cppyy
402-
os: ubuntu-22.04
403-
compiler: gcc-12
404-
clang-runtime: '17'
405-
cling: Off
406-
cppyy: On
407-
- name: ubu22-x86-gcc12-clang-repl-16
408-
os: ubuntu-22.04
409-
compiler: gcc-12
410-
clang-runtime: '16'
411-
cling: Off
412-
cppyy: Off
413-
- name: ubu22-x86-gcc9-clang13-cling-cppyy
414-
os: ubuntu-22.04
415-
compiler: gcc-9
416-
clang-runtime: '13'
417-
cling: On
418-
cling-version: '1.0'
419-
cppyy: On
420302
- name: osx15-arm-clang-clang-repl-19-cppyy
421303
os: macos-15
422304
compiler: clang
@@ -490,7 +372,7 @@ jobs:
490372
with:
491373
python-version: '3.11'
492374

493-
- name: Save PR Info on Unix systems
375+
- name: Save PR Info
494376
run: |
495377
mkdir -p ./pr
496378
echo ${{ github.event.number }} > ./pr/NR
@@ -510,43 +392,13 @@ jobs:
510392
echo "CLING_HASH=$CLING_HASH" >> $GITHUB_ENV
511393
echo "LLVM_HASH=$LLVM_HASH" >> $GITHUB_ENV
512394
513-
- name: Setup default Build Type on *nux
395+
- name: Setup default Build Type
514396
run: |
515397
echo "BUILD_TYPE=Release" >> $GITHUB_ENV
516398
echo "CODE_COVERAGE=0" >> $GITHUB_ENV
517-
os="${{ matrix.os }}"
518-
if [[ "${os}" == "macos"* ]]; then
519-
echo "ncpus=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV
520-
else
521-
echo "ncpus=$(nproc --all)" >> $GITHUB_ENV
522-
fi
399+
echo "ncpus=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV
523400
524-
- name: Setup compiler on Linux
525-
if: runner.os == 'Linux'
526-
run: |
527-
# https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html
528-
vers="${compiler#*-}"
529-
os_codename="`cat /etc/os-release | grep UBUNTU_CODENAME | cut -d = -f 2`"
530-
##sudo apt update
531-
if [[ "${{ matrix.compiler }}" == *"gcc"* ]]; then
532-
sudo apt install -y gcc-${vers} g++-${vers} lld
533-
echo "CC=gcc-${vers}" >> $GITHUB_ENV
534-
echo "CXX=g++-${vers}" >> $GITHUB_ENV
535-
else
536-
if ! sudo apt install -y clang-${vers}; then
537-
curl https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
538-
echo "deb https://apt.llvm.org/${os_codename}/ llvm-toolchain-${os_codename}-${vers} main" | sudo tee -a /etc/apt/sources.list
539-
sudo apt-get update
540-
sudo apt install -y clang-${vers}
541-
fi
542-
echo "CC=clang-${vers}" >> $GITHUB_ENV
543-
echo "CXX=clang++-${vers}" >> $GITHUB_ENV
544-
fi
545-
env:
546-
compiler: ${{ matrix.compiler }}
547-
548-
- name: Setup compiler on macOS
549-
if: runner.os == 'macOS'
401+
- name: Setup compiler
550402
run: |
551403
vers="${compiler#*-}"
552404
if [[ "${{ matrix.compiler }}" == *"gcc"* ]]; then
@@ -582,22 +434,7 @@ jobs:
582434
env:
583435
compiler: ${{ matrix.compiler }}
584436

585-
- name: Install deps on Linux
586-
if: runner.os == 'Linux'
587-
run: |
588-
# Install deps
589-
sudo apt-get update
590-
sudo apt-get install git g++ debhelper devscripts gnupg python3 doxygen graphviz python3-sphinx
591-
sudo apt-get install -y libc6-dbg
592-
sudo snap install valgrind --classic
593-
sudo apt autoremove
594-
sudo apt clean
595-
# Install libraries used by the cppyy test suite
596-
sudo apt install libeigen3-dev
597-
sudo apt install libboost-all-dev
598-
599-
- name: Install deps on MacOS
600-
if: runner.os == 'macOS'
437+
- name: Install deps
601438
run: |
602439
brew update --force
603440
export ARCHITECHURE=$(uname -m)
@@ -627,14 +464,7 @@ jobs:
627464
${{ matrix.cling=='On' && 'cling' || '' }}
628465
key: ${{ env.CLING_HASH }}-${{ runner.os }}-${{ matrix.os }}-${{ matrix.compiler }}-clang-${{ matrix.clang-runtime }}.x-patch-${{ hashFiles(format('patches/llvm/clang{0}-*.patch', matrix.clang-runtime)) || 'none' }}
629466

630-
- name: Setup code coverage
631-
if: ${{ success() && (matrix.coverage == true) }}
632-
run: |
633-
sudo apt install lcov
634-
echo "CODE_COVERAGE=1" >> $GITHUB_ENV
635-
echo "BUILD_TYPE=Debug" >> $GITHUB_ENV
636-
637-
- name: Build and Test/Install CppInterOp on Unix systems
467+
- name: Build and Test/Install CppInterOp
638468
run: |
639469
LLVM_DIR="$(pwd)/llvm-project"
640470
LLVM_BUILD_DIR="$(pwd)/llvm-project/build"
@@ -678,17 +508,7 @@ jobs:
678508
-DLLVM_ENABLE_WERROR=On \
679509
../
680510
fi
681-
os="${{ matrix.os }}"
682-
docs_on=$(echo "${{ matrix.documentation }}" | tr '[:lower:]' '[:upper:]')
683-
if [[ "${docs_on}" == "ON" ]]; then
684-
cmake --build . --target doxygen-cppinterop --parallel ${{ env.ncpus }}
685-
cmake --build . --target sphinx-cppinterop --parallel ${{ env.ncpus }}
686-
else
687-
cmake --build . --target check-cppinterop --parallel ${{ env.ncpus }}
688-
if [[ ("${os}" == "ubuntu"*) ]]; then
689-
valgrind --show-error-list=yes --track-origins=yes --error-exitcode=1 unittests/CppInterOp/CppInterOpTests
690-
fi
691-
fi
511+
cmake --build . --target check-cppinterop --parallel ${{ env.ncpus }}
692512
cd ..
693513
# We need CB_PYTHON_DIR later
694514
echo "CB_PYTHON_DIR=$CB_PYTHON_DIR" >> $GITHUB_ENV
@@ -698,27 +518,7 @@ jobs:
698518
echo "LLVM_BUILD_DIR=$LLVM_BUILD_DIR" >> $GITHUB_ENV
699519
echo "CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH" >> $GITHUB_ENV
700520
701-
- name: Prepare code coverage report
702-
if: ${{ success() && (matrix.coverage == true) }}
703-
run: |
704-
# Create lcov report
705-
# capture coverage info
706-
vers="${CC#*-}"
707-
lcov --directory build/ --capture --output-file coverage.info --gcov-tool /usr/bin/gcov-${vers}
708-
lcov --remove coverage.info '/usr/*' "${HOME}"'/.cache/*' ${{ github.workspace }}'/llvm-project/*' ${{ github.workspace }}'/unittests/*' --output-file coverage.info
709-
# output coverage data for debugging (optional)
710-
lcov --list coverage.info
711-
712-
- name: Upload to codecov.io
713-
if: ${{ success() && (matrix.coverage == true) }}
714-
uses: codecov/codecov-action@v4
715-
with:
716-
file: ./coverage.info
717-
fail_ci_if_error: true
718-
verbose: true
719-
token: ${{ secrets.CODECOV_TOKEN }}
720-
721-
- name: Build and Install cppyy-backend on Unix Systems
521+
- name: Build and Install cppyy-backend
722522
if: ${{ matrix.cppyy == 'On' }}
723523
run: |
724524
# Download cppyy-backend
@@ -730,15 +530,10 @@ jobs:
730530
# Build and Install cppyy-backend
731531
cmake -DCppInterOp_DIR=$CPPINTEROP_DIR ..
732532
cmake --build . --parallel ${{ env.ncpus }}
733-
OS=$(uname -s)
734-
if [[ "$OS" == "Darwin" ]]; then
735-
cp libcppyy-backend.dylib $CPPINTEROP_DIR/lib/
736-
else
737-
cp libcppyy-backend.so $CPPINTEROP_DIR/lib/
738-
fi
533+
cp libcppyy-backend.dylib $CPPINTEROP_DIR/lib/
739534
cd ..
740535
741-
- name: Install CPyCppyy on Unix Systems
536+
- name: Install CPyCppyy
742537
if: ${{ matrix.cppyy == 'On' }}
743538
run: |
744539
python3 -m venv .venv
@@ -754,7 +549,7 @@ jobs:
754549
cd ../..
755550
# We need CPYCPPYY_DIR later
756551
echo "CPYCPPYY_DIR=$CPYCPPYY_DIR" >> $GITHUB_ENV
757-
- name: Install cppyy on Unix Systems
552+
- name: Install cppyy
758553
if: ${{ matrix.cppyy == 'On' }}
759554
run: |
760555
# source virtual environment
@@ -764,7 +559,7 @@ jobs:
764559
cd cppyy
765560
python -m pip install --upgrade . --no-deps
766561
cd ..
767-
- name: Run cppyy on Unix Systems
562+
- name: Run cppyy
768563
if: ${{ matrix.cppyy == 'On' }}
769564
run: |
770565
# Run cppyy
@@ -773,7 +568,7 @@ jobs:
773568
python -c "import cppyy"
774569
# We need PYTHONPATH later
775570
echo "PYTHONPATH=$PYTHONPATH" >> $GITHUB_ENV
776-
- name: Run the tests on Unix Systems
571+
- name: Run the tests
777572
if: ${{ matrix.cppyy == 'On' }}
778573
run: |
779574
# Run the tests
@@ -811,14 +606,6 @@ jobs:
811606
declare -i RETCODE=0
812607
813608
set -o pipefail
814-
if [[ "${{ matrix.os }}" == macos-* ]]; then
815-
echo "Skipping Valgrind checks on OS X"
816-
else
817-
echo "Running valgrind on passing tests"
818-
CLANG_VERSION="${{ matrix.clang-runtime }}"
819-
SUPPRESSION_FILE="../etc/clang${CLANG_VERSION}-valgrind.supp"
820-
valgrind --show-error-list=yes --error-exitcode=1 --track-origins=yes --suppressions="${SUPPRESSION_FILE}" --suppressions=../etc/valgrind-cppyy-cling.supp python -m pytest -m "not xfail" -sv -ra
821-
fi
822609
export RETCODE=+$?
823610
echo ::endgroup::
824611

0 commit comments

Comments
 (0)