Skip to content

Commit

Permalink
modernize ci, update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
petiaccja committed Oct 7, 2024
1 parent 8c93abb commit 798e233
Show file tree
Hide file tree
Showing 27 changed files with 370 additions and 3,599 deletions.
13 changes: 13 additions & 0 deletions .github/build_profiles/clang17d
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[settings]
arch=x86_64
build_type=Debug
compiler=clang
compiler.cppstd=17
compiler.libcxx=libstdc++11
compiler.version=17
os=Linux

[conf]
tools.build:compiler_executables={'c': 'clang', 'cpp': 'clang++' }
tools.cmake.cmaketoolchain:generator=Ninja
tools.cmake.cmake_layout:build_folder_vars=["settings.compiler", "settings.compiler.cppstd", "settings.build_type"]
13 changes: 13 additions & 0 deletions .github/build_profiles/clang17r
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[settings]
arch=x86_64
build_type=Release
compiler=clang
compiler.cppstd=17
compiler.libcxx=libstdc++11
compiler.version=17
os=Linux

[conf]
tools.build:compiler_executables={'c': 'clang', 'cpp': 'clang++' }
tools.cmake.cmaketoolchain:generator=Ninja
tools.cmake.cmake_layout:build_folder_vars=["settings.compiler", "settings.compiler.cppstd", "settings.build_type"]
13 changes: 13 additions & 0 deletions .github/build_profiles/clang20d
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[settings]
arch=x86_64
build_type=Debug
compiler=clang
compiler.cppstd=20
compiler.libcxx=libstdc++11
compiler.version=17
os=Linux

[conf]
tools.build:compiler_executables={'c': 'clang', 'cpp': 'clang++' }
tools.cmake.cmaketoolchain:generator=Ninja
tools.cmake.cmake_layout:build_folder_vars=["settings.compiler", "settings.compiler.cppstd", "settings.build_type"]
13 changes: 13 additions & 0 deletions .github/build_profiles/clang20r
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[settings]
arch=x86_64
build_type=Release
compiler=clang
compiler.cppstd=20
compiler.libcxx=libstdc++11
compiler.version=17
os=Linux

[conf]
tools.build:compiler_executables={'c': 'clang', 'cpp': 'clang++' }
tools.cmake.cmaketoolchain:generator=Ninja
tools.cmake.cmake_layout:build_folder_vars=["settings.compiler", "settings.compiler.cppstd", "settings.build_type"]
13 changes: 13 additions & 0 deletions .github/build_profiles/gcc17d
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[settings]
arch=x86_64
build_type=Debug
compiler=gcc
compiler.cppstd=17
compiler.libcxx=libstdc++11
compiler.version=13
os=Linux

[conf]
tools.build:compiler_executables={'c': 'gcc', 'cpp': 'g++' }
tools.cmake.cmaketoolchain:generator=Ninja
tools.cmake.cmake_layout:build_folder_vars=["settings.compiler", "settings.compiler.cppstd", "settings.build_type"]
13 changes: 13 additions & 0 deletions .github/build_profiles/gcc17r
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=17
compiler.libcxx=libstdc++11
compiler.version=13
os=Linux

[conf]
tools.build:compiler_executables={'c': 'gcc', 'cpp': 'g++' }
tools.cmake.cmaketoolchain:generator=Ninja
tools.cmake.cmake_layout:build_folder_vars=["settings.compiler", "settings.compiler.cppstd", "settings.build_type"]
13 changes: 13 additions & 0 deletions .github/build_profiles/gcc20d
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[settings]
arch=x86_64
build_type=Debug
compiler=gcc
compiler.cppstd=20
compiler.libcxx=libstdc++11
compiler.version=13
os=Linux

[conf]
tools.build:compiler_executables={'c': 'gcc', 'cpp': 'g++' }
tools.cmake.cmaketoolchain:generator=Ninja
tools.cmake.cmake_layout:build_folder_vars=["settings.compiler", "settings.compiler.cppstd", "settings.build_type"]
13 changes: 13 additions & 0 deletions .github/build_profiles/gcc20r
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=20
compiler.libcxx=libstdc++11
compiler.version=13
os=Linux

[conf]
tools.build:compiler_executables={'c': 'gcc', 'cpp': 'g++' }
tools.cmake.cmaketoolchain:generator=Ninja
tools.cmake.cmake_layout:build_folder_vars=["settings.compiler", "settings.compiler.cppstd", "settings.build_type"]
13 changes: 13 additions & 0 deletions .github/build_profiles/msvc17d
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[settings]
arch=x86_64
build_type=Debug
compiler=msvc
compiler.cppstd=17
compiler.version=193
compiler.runtime=dynamic
os=Windows

[conf]
tools.build:compiler_executables={'c': 'cl.exe', 'cpp': 'cl.exe' }
tools.cmake.cmaketoolchain:generator=Ninja
tools.cmake.cmake_layout:build_folder_vars=["settings.compiler", "settings.compiler.cppstd", "settings.build_type"]
13 changes: 13 additions & 0 deletions .github/build_profiles/msvc17r
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=17
compiler.version=193
compiler.runtime=dynamic
os=Windows

[conf]
tools.build:compiler_executables={'c': 'cl.exe', 'cpp': 'cl.exe' }
tools.cmake.cmaketoolchain:generator=Ninja
tools.cmake.cmake_layout:build_folder_vars=["settings.compiler", "settings.compiler.cppstd", "settings.build_type"]
13 changes: 13 additions & 0 deletions .github/build_profiles/msvc20d
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[settings]
arch=x86_64
build_type=Debug
compiler=msvc
compiler.cppstd=20
compiler.version=193
compiler.runtime=dynamic
os=Windows

[conf]
tools.build:compiler_executables={'c': 'cl.exe', 'cpp': 'cl.exe' }
tools.cmake.cmaketoolchain:generator=Ninja
tools.cmake.cmake_layout:build_folder_vars=["settings.compiler", "settings.compiler.cppstd", "settings.build_type"]
13 changes: 13 additions & 0 deletions .github/build_profiles/msvc20r
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=20
compiler.version=193
compiler.runtime=dynamic
os=Windows

[conf]
tools.build:compiler_executables={'c': 'cl.exe', 'cpp': 'cl.exe' }
tools.cmake.cmaketoolchain:generator=Ninja
tools.cmake.cmake_layout:build_folder_vars=["settings.compiler", "settings.compiler.cppstd", "settings.build_type"]
120 changes: 71 additions & 49 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,79 +14,101 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest]
c_compiler: [gcc, clang, cl]
build_type: [Debug, Release]
cxx_standard: ["17", "20"]
build_profile: [clang20d, clang20r, gcc20d, gcc20r, msvc20d, msvc20r, clang17d, clang17r, gcc17d, gcc17r, msvc17d, msvc17r]
include:
- c_compiler: gcc
cxx_compiler: g++
- c_compiler: clang
cxx_compiler: clang++
- c_compiler: cl
cxx_compiler: cl
- os: windows-latest
test_name: .\Bin\UnitTest.exe
- os: ubuntu-latest
test_name: ./Bin/UnitTest
- build_type: Debug
conan_preset: "conan-debug"
- build_type: Release
conan_preset: "conan-release"
exclude:
- os: windows-latest
c_compiler: gcc
- os: windows-latest
c_compiler: clang
- os: ubuntu-latest
c_compiler: cl
- build_profile: clang20d
conan_preset: clang-20-debug
os: ubuntu-latest
- build_profile: clang20r
conan_preset: clang-20-release
os: ubuntu-latest
- build_profile: gcc20d
conan_preset: gcc-20-debug
os: ubuntu-latest
- build_profile: gcc20r
conan_preset: gcc-20-release
os: ubuntu-latest
- build_profile: msvc20d
conan_preset: msvc-20-debug
os: windows-latest
- build_profile: msvc20r
conan_preset: msvc-20-release
os: windows-latest
- build_profile: clang17d
conan_preset: clang-17-debug
os: ubuntu-latest
- build_profile: clang17r
conan_preset: clang-17-release
os: ubuntu-latest
- build_profile: gcc17d
conan_preset: gcc-17-debug
os: ubuntu-latest
- build_profile: gcc17r
conan_preset: gcc-17-release
os: ubuntu-latest
- build_profile: msvc17d
conan_preset: msvc-17-debug
os: windows-latest
- build_profile: msvc17r
conan_preset: msvc-17-release
os: windows-latest

name: ${{ matrix.c_compiler }} - ${{ matrix.build_type }} - ${{ matrix.os }} - c++${{ matrix.cxx_standard }}
name: ${{ matrix.build_profile }}

runs-on: ${{matrix.os}}

env:
CMAKE_EXTRA: "-DDSPBB_BUILD_TESTS:BOOL=ON -DDSPBB_BUILD_EXAMPLES:BOOL=ON -DDSPBB_BUILD_BENCHMARKS:BOOL=ON"

steps:
- uses: actions/checkout@v2
- uses: seanmiddleditch/gha-setup-ninja@v3
- uses: actions/checkout@v4
- uses: seanmiddleditch/gha-setup-ninja@v4
- uses: seanmiddleditch/gha-setup-vsdevenv@master

- name: Install conan
shell: bash
env:
CC: "${{ matrix.c_compiler != 'cl' && matrix.c_compiler || '' }}"
CXX: "${{ matrix.cxx_compiler != 'cl' && matrix.cxx_compiler || '' }}"
- run: pip install conan

- name: Install native compilers
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
pip install conan
conan profile detect --name ci --force
python $GITHUB_WORKSPACE/support/update-conan-profile.py $(conan profile path ci) ${{matrix.build_type}} ${{matrix.c_compiler}} ${{matrix.cxx_compiler}} ${{matrix.cxx_standard}}
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install gcc-13 g++-13
sudo update-alternatives --remove-all gcc || true
sudo update-alternatives --remove-all g++ || true
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 10 --slave /usr/bin/g++ g++ /usr/bin/g++-13
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 17 clang
sudo update-alternatives --remove-all clang || true
sudo update-alternatives --remove-all clang++ || true
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-17 10 --slave /usr/bin/clang++ clang++ /usr/bin/clang++-17
- name: Cache conan packages
id: cache-conan
uses: actions/cache@v3
with:
path: ~/.conan2/p
key: conan-cache-packages-${{ matrix.os }}-${{ matrix.c_compiler }}-${{ matrix.build_type }}-${{ matrix.cxx_standard }}
key: conan-cache-packages-${{ matrix.build_profile }}

- name: Create Build Environment
run: cmake -E make_directory ${{runner.workspace}}/build
run: cmake -E make_directory ${{github.workspace}}/build

- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/build
env:
CC: ${{matrix.c_compiler}}
CXX: ${{matrix.cxx_compiler}}
PR: "${{github.workspace}}/.github/build_profiles/${{matrix.build_profile}}"
run: |
conan install $GITHUB_WORKSPACE --output-folder=. --build=missing -pr ci -pr:b ci -s build_type=${{ matrix.build_type }}
cmake -E make_directory "${{github.workspace}}/build"
conan install "${{github.workspace}}" --build=missing -pr $PR -pr:b $PR
conan cache clean
cmake $GITHUB_WORKSPACE --preset ${{ matrix.conan_preset }}
cmake ${{env.CMAKE_EXTRA}} -S "${{github.workspace}}" --preset conan-${{ matrix.conan_preset }}
- name: Build
working-directory: ${{runner.workspace}}/build
shell: bash
run: cmake --build . --config ${{matrix.build_type}}
run: |
cmake --build --preset conan-${{ matrix.conan_preset }}
- name: Test
working-directory: ${{runner.workspace}}/build
shell: bash
run: ./Bin/UnitTest
run: ${{github.workspace}}/build/${{ matrix.conan_preset }}/bin/UnitTest
21 changes: 12 additions & 9 deletions .github/workflows/clang_format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,21 @@ on:
types: [opened, synchronize, reopened]
jobs:
verify:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: seanmiddleditch/gha-setup-vsdevenv@master
with:
fetch-depth: 1
- uses: KyleMayes/install-llvm-action@v1
with:
version: "12.0"
directory: ${{ runner.temp }}/llvm
- name: Install clang-format
run: |
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
sudo add-apt-repository -y "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-18 main"
sudo apt-get update
sudo apt-get install clang-format-18
which clang-format-18
sudo update-alternatives --remove-all clang-format || true
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-18 10
- name: Verify formatting
run: |
python ./support/run-clang-format.py -r --exclude "*pocketfft*" include
Expand Down
26 changes: 0 additions & 26 deletions .github/workflows/deploy.yml

This file was deleted.

Loading

0 comments on commit 798e233

Please sign in to comment.