Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor CI
Browse files Browse the repository at this point in the history
Set libraries download in alphabetical order.
Bump actions/checkout to v4.
Change run_tests matrix to more readable.
Add env field to avoid code duplications inside job. resolves #512
Vdaleke committed Jan 29, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 9e45fa5 commit fc2101e
Showing 5 changed files with 90 additions and 101 deletions.
68 changes: 36 additions & 32 deletions .github/composite-actions/install-dependencies/action.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
name: 'Install dependencies'
description: 'Download and install build system and libraries'
inputs:
download-pybind:
type: boolean
description: 'Download pybind11'
default: false

download-googletest:
type: boolean
description: 'Download googletest'
default: true

os:
type: string
description: 'Any default runner name in Github Actions'
required: true

toolset:
@@ -31,10 +22,20 @@ inputs:
type: boolean
default: true

download-googletest:
type: boolean
description: 'Download googletest'
default: true

download-pybind:
type: boolean
description: 'Download pybind11'
default: false

runs:
using: 'composite'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Get short OS name
shell: bash
@@ -93,51 +94,54 @@ runs:
mkdir -p lib
shell: bash

- name: Download googletest
uses: ./.github/composite-actions/download-library
with:
directory: googletest
download-command: git clone https://github.com/google/googletest/ --branch v1.14.0 --depth 1
if: inputs.download-googletest != 'false'

- name: Download easyloggingpp
- name: Download atomicbitvector
uses: ./.github/composite-actions/download-library
with:
directory: easyloggingpp
download-command: git clone https://github.com/amrayn/easyloggingpp/ --branch v9.97.0 --depth 1
directory: atomicbitvector
download-command: git clone https://github.com/ekg/atomicbitvector.git --depth 1

- name: Download better-enums
uses: ./.github/composite-actions/download-library
with:
directory: better-enums
download-command: git clone https://github.com/aantron/better-enums.git --branch 0.11.3 --depth 1

- name: Download pybind11
- name: Download boost
uses: ./.github/composite-actions/download-library
with:
directory: pybind11
download-command: git clone https://github.com/pybind/pybind11.git --branch v2.13.4 --depth 1
if: inputs.download-pybind != 'false'
directory: boost
download-command: wget -O boost_1_85_0.tar.gz https://sourceforge.net/projects/boost/files/boost/1.85.0/boost_1_85_0.tar.gz/download && tar xzvf boost_1_85_0.tar.gz && mv boost_1_85_0 boost

- name: Download easyloggingpp
uses: ./.github/composite-actions/download-library
with:
directory: easyloggingpp
download-command: git clone https://github.com/amrayn/easyloggingpp/ --branch v9.97.0 --depth 1

- name: Download emhash
uses: ./.github/composite-actions/download-library
with:
directory: emhash
download-command: git clone https://github.com/ktprime/emhash.git --depth 1
- name: Download atomicbitvector

- name: Download googletest
uses: ./.github/composite-actions/download-library
with:
directory: atomicbitvector
download-command: git clone https://github.com/ekg/atomicbitvector.git --depth 1
- name: Download boost
directory: googletest
download-command: git clone https://github.com/google/googletest/ --branch v1.14.0 --depth 1
if: inputs.download-googletest != 'false'

- name: Download pybind11
uses: ./.github/composite-actions/download-library
with:
directory: boost
download-command: wget -O boost_1_85_0.tar.gz https://sourceforge.net/projects/boost/files/boost/1.85.0/boost_1_85_0.tar.gz/download && tar xzvf boost_1_85_0.tar.gz && mv boost_1_85_0 boost
directory: pybind11
download-command: git clone https://github.com/pybind/pybind11.git --branch v2.13.4 --depth 1
if: inputs.download-pybind != 'false'

- name: Install Boost built with GCC (on Ubuntu)
run: |
cd lib/boost
./bootstrap.sh --prefix=/usr --with-libraries=container,thread,graph
./bootstrap.sh --with-libraries=container,thread,graph
sudo ./b2 install --prefix=/usr
shell: bash
if: inputs.install-boost == 'true' && inputs.toolset == 'gcc' && env.OS == 'ubuntu'
19 changes: 10 additions & 9 deletions .github/workflows/bindings-tests.yml
Original file line number Diff line number Diff line change
@@ -30,43 +30,44 @@ on:
workflow_dispatch:
jobs:
test-python-bindings:
name: Run python-bindings tests on ${{ matrix.os }} with ${{ matrix.toolset }}
strategy:
matrix:
include:
- os: ubuntu-latest
compiler: gcc
toolset: gcc
env: CXX=g++-10

- os: ubuntu-latest
compiler: llvm-clang
toolset: llvm-clang
env: CXX=clang++-17 CXXFLAGS="-stdlib=libc++" LDFLAGS="-lc++abi"

# Uncomment this to enable macOS gcc tests:
# - os: macos-latest
# compiler: gcc
# toolset: gcc
# env: CXX=g++-14 BOOST_ROOT=/usr/local
# runtime-env: DYLD_LIBRARY_PATH=/usr/local/lib:${DYLD_LIBRARY_PATH}

# Uncomment this to enable llvm-clang tests:
# Uncomment this to enable macOS llvm-clang tests:
# - os: macos-latest
# compiler: llvm-clang
# toolset: llvm-clang
# env: CXX=$(brew --prefix llvm@17)/bin/clang++ BOOST_ROOT=/usr/local
# runtime-env: DYLD_LIBRARY_PATH=/usr/local/lib:${DYLD_LIBRARY_PATH}

- os: macos-latest
compiler: apple-clang
toolset: apple-clang
env: CXX=clang++ BOOST_ROOT=$(brew --prefix boost)

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install dependencies
uses: ./.github/composite-actions/install-dependencies
with:
os: ${{ matrix.os }}
toolset: ${{ matrix.compiler }}
download-pybind: true
toolset: ${{ matrix.toolset }}
download-googletest: false
download-pybind: true
- name: Build pip package
shell: bash
run: |
2 changes: 1 addition & 1 deletion .github/workflows/check-codestyle.yml
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ jobs:
clang-format-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Pull clang-format
94 changes: 39 additions & 55 deletions .github/workflows/core-tests.yml
Original file line number Diff line number Diff line change
@@ -28,74 +28,60 @@ on:
workflow_dispatch:
jobs:
run_tests:
name: Run core-tests on ${{ matrix.system.os }} with ${{ matrix.system.toolset }}, ${{matrix.cfg.BUILD_TYPE}} ${{ matrix.cfg.SANITIZER }}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
compiler:
- gcc
- llvm-clang
- apple-clang
system:
- {
os: ubuntu-latest,
toolset: gcc,
env: CXX=g++-10,
}
- {
os: ubuntu-latest,
toolset: llvm-clang,
env: CXX=clang++-17 CXXFLAGS="-stdlib=libc++" LDFLAGS="-lc++abi"
}
# Uncomment this to enable macOS GCC tests:
# - {
# os: macos-latest,
# toolset: gcc,
# env: CXX=g++-14 BOOST_ROOT=/usr/local,
# runtime-env: DYLD_LIBRARY_PATH=/usr/local/lib:${DYLD_LIBRARY_PATH}
# }
# Uncomment this to enable macOS LLVM Clang tests:
# - {
# os: macos-latest,
# toolset: llvm-clang,
# env: CXX=$(brew --prefix llvm@17)/bin/clang++ CXXFLAGS="-I$(brew --prefix llvm@17)/include" \
# LDFLAGS="-L$(brew --prefix llvm@17)/lib/c++" BOOST_ROOT=/usr/local,
# runtime-env: DYLD_LIBRARY_PATH=/usr/local/lib:${DYLD_LIBRARY_PATH}
# }
- {
os: macos-latest,
toolset: apple-clang,
env: CXX=clang++,
}
cfg:
- { BUILD_TYPE: Release }
- { BUILD_TYPE: Debug }
- { BUILD_TYPE: Debug, SANITIZER : ADDRESS }
- { BUILD_TYPE: Debug, SANITIZER : UB }
exclude:
- os: ubuntu-latest
compiler: apple-clang
# Comment this to enable macOS-gcc tests:
- os: macos-latest
compiler: gcc
# Comment this to enable macOS-llvm-clang tests:
- os: macos-latest
compiler: llvm-clang
runs-on: ${{ matrix.os }}

runs-on: ${{ matrix.system.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install dependencies
uses: ./.github/composite-actions/install-dependencies
with:
os: ${{ matrix.os }}
toolset: ${{ matrix.compiler }}
os: ${{ matrix.system.os }}
toolset: ${{ matrix.system.toolset }}
- name: Download datasets
uses: ./.github/composite-actions/download-datasets
- name: Build
shell: bash
# Maybe separate composite action will be more readable?
run: |
if [[ ${{ matrix.os }} == 'ubuntu-latest' && ${{ matrix.compiler }} == 'gcc' ]]; then
echo "Ubuntu, GCC"
export CXX=g++-10
elif [[ ${{ matrix.os }} == 'ubuntu-latest' && ${{ matrix.compiler }} == 'llvm-clang' ]]; then
echo "Ubuntu, LLVM Clang"
export CXX=clang++-17
export CXXFLAGS="-stdlib=libc++"
export LDFLAGS="-lc++abi"
elif [[ ${{ matrix.os }} == 'macos-latest' && ${{ matrix.compiler }} == 'gcc' ]]; then
echo "macOS, GCC"
export CXX=g++-14
export BOOST_ROOT=/usr/local
elif [[ ${{ matrix.os }} == 'macos-latest' && ${{ matrix.compiler }} == 'llvm-clang' ]]; then
echo "macOS, LLVM Clang"
export CXX=$(brew --prefix llvm@17)/bin/clang++
export CXXFLAGS="-I$(brew --prefix llvm@17)/include"
export LDFLAGS="-L$(brew --prefix llvm@17)/lib/c++"
export BOOST_ROOT=/usr/local
elif [[ ${{ matrix.os }} == 'macos-latest' && ${{ matrix.compiler }} == 'apple-clang' ]]; then
echo "macOS, Apple Clang"
export CC=clang
export CXX=clang++
else
echo 'Invalid matrix configuration'
exit 1
fi
export ${{ matrix.system.env }}
if [[ "${{matrix.cfg.BUILD_TYPE}}" == "Debug" ]]; then
./build.sh --debug --sanitizer=${{ matrix.cfg.SANITIZER }}
@@ -106,8 +92,6 @@ jobs:
working-directory: ${{github.workspace}}/build/target
shell: bash
run: |
if [[ ${{ matrix.os }} == 'macos-latest' ]]; then
export DYLD_LIBRARY_PATH=/usr/local/lib:${DYLD_LIBRARY_PATH}
fi
export ${{ matrix.system.runtime-env }}
./Desbordante_test --gtest_filter='*:-*HeavyDatasets*'
8 changes: 4 additions & 4 deletions .github/workflows/wheel.yml
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@ jobs:
outputs:
include: ${{ steps.set-matrix.outputs.include }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install cibuildwheel
run: pipx install cibuildwheel==2.16.2
- id: set-matrix
@@ -68,7 +68,7 @@ jobs:
include: ${{ fromJson(needs.generate-wheels-matrix.outputs.include) }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install dependencies
uses: ./.github/composite-actions/install-dependencies
@@ -108,7 +108,7 @@ jobs:
runs-on: ubuntu-latest
needs: build-wheels
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Download all artifacts from previous step
uses: actions/download-artifact@v4
with:
@@ -142,7 +142,7 @@ jobs:
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Download wheels
uses: actions/download-artifact@v4
with:

0 comments on commit fc2101e

Please sign in to comment.