Skip to content

Commit

Permalink
Merge branch 'main' into system-refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
ishan-tyagi authored Jun 14, 2024
2 parents e123348 + e0df401 commit e644411
Show file tree
Hide file tree
Showing 345 changed files with 18,033 additions and 34,880 deletions.
2 changes: 2 additions & 0 deletions .github/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
conan==2.3.2
ninja==1.11.1.1
71 changes: 57 additions & 14 deletions .github/workflows/linux-clang-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
push:
branches:
- 'main'
paths-ignore:
- 'docs/**'
- '**/*.md'
- 'LICENSE'
workflow_dispatch:
pull_request:

Expand All @@ -14,34 +18,73 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install ccache
uses: hendrikmuhs/[email protected]

- name: Cache Conan packages
id: cache-conan
uses: actions/[email protected]
env:
cache-name: cache-conan-packages
with:
submodules: recursive
path: ~/.conan2
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('conanfile.txt') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Configure python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'

- name: Install Python dependencies
run: pip install -r .github/requirements.txt

- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@master
- name: Configure Conan profiles
run: |
CC=clang-18 \
CXX=clang++-18 \
conan profile detect --force --name clang-18
- name: Install Conan dependencies
run: |
conan install conanfile.txt \
-r conancenter \
-pr:b clang-18 \
-pr:h clang-18 \
-s compiler.cppstd=20 \
-s build_type=Debug \
-o "*:shared=True" \
-c:b tools.build:compiler_executables="{'c': '/usr/bin/clang-18', 'cpp': '/usr/bin/clang++-18'}" \
-c:h tools.build:compiler_executables="{'c': '/usr/bin/clang-18', 'cpp': '/usr/bin/clang++-18'}" \
--build=missing \
- name: Configure CMake
run: |
cmake -S ${{github.workspace}} --preset=unixlike-clang-debug \
-DCMAKE_C_COMPILER=/usr/bin/clang-18 \
-DCMAKE_CXX_COMPILER=/usr/bin/clang++-18 \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCODE_COVERAGE:BOOL=ON \
-DBUILD_TESTING:BOOL=ON
-DBUILD_TESTING:BOOL=ON \
-DBUILD_EXAMPLES:BOOL=ON \
-DUSE_SYSTEM_DEPENDENCIES:BOOL=ON \
-DUSE_STD_FORMAT:BOOL=ON \
-DCMAKE_TOOLCHAIN_FILE=build/Debug/generators/conan_toolchain.cmake \
-DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld
- name: Build
run: cmake --build --preset=unixlike-clang-debug

- name: Test
run: ctest --preset=unixlike-clang-debug

- name: Generate code coverage
working-directory: ${{github.workspace}}/build/unixlike-clang-debug
- name: Examples
run: |
ninja faker-ccov-all \
&& llvm-cov-18 show `cat ccov/binaries.list` -instr-profile=ccov/all-merged.profdata > coverage.txt
- name: Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOVTOKEN }}
cmake --build --preset=unixlike-clang-debug --target run-faker-cxx-basic-example \
&& cmake --build --preset=unixlike-clang-debug --target run-faker-cxx-person-example
45 changes: 0 additions & 45 deletions .github/workflows/linux-conan.yml

This file was deleted.

60 changes: 46 additions & 14 deletions .github/workflows/linux-gxx-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,78 @@ on:
push:
branches:
- 'main'
paths-ignore:
- 'docs/**'
- '**/*.md'
- 'LICENSE'
workflow_dispatch:
pull_request:

jobs:
build:
name: ci-ubuntu-24.04-gcc-${{ matrix.build_options.gcc_version }}
name: ci-ubuntu-24.04-gcc-${{ matrix.gcc_version }}
runs-on: ubuntu-24.04
strategy:
matrix:
build_options: [ {gcc_version: 12, use_system_deps: ON, toolchain_file: build/Debug/generators/conan_toolchain.cmake}, {gcc_version: 13, use_system_deps: OFF, toolchain_file: OFF} ]
gcc_version: [12, 13]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install ccache
uses: hendrikmuhs/[email protected]

- name: Cache Conan packages
id: cache-conan
uses: actions/[email protected]
env:
cache-name: cache-conan-packages
with:
submodules: recursive
path: ~/.conan2
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('conanfile.txt') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Configure python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'

- name: Install conan and ninja
run: pip install conan ninja
- name: Install Python dependencies
run: pip install -r .github/requirements.txt

- name: Configure Conan profile
if: ${{ matrix.build_options.use_system_deps == 'ON' }}
run: CC=gcc-12 CXX=g++-12 conan profile detect
run: |
CC=gcc-${{ matrix.gcc_version }} \
CXX=g++-${{ matrix.gcc_version }} \
conan profile detect --force --name gcc-${{ matrix.gcc_version }}
- name: Install Conan dependencies
if: ${{ matrix.build_options.use_system_deps == 'ON' }}
run: conan install conanfile.txt -r conancenter -s compiler.cppstd=20 -s build_type=Debug -o "*:shared=True" --build=missing
run: |
conan install conanfile.txt \
-r conancenter \
-pr:b gcc-${{ matrix.gcc_version }} \
-pr:h gcc-${{ matrix.gcc_version }} \
-s compiler.cppstd=20 \
-s build_type=Debug \
-c:b tools.build:compiler_executables="{'c': '/usr/bin/gcc-${{ matrix.gcc_version }}', 'cpp': '/usr/bin/g++-${{ matrix.gcc_version }}'}" \
-c:h tools.build:compiler_executables="{'c': '/usr/bin/gcc-${{ matrix.gcc_version }}', 'cpp': '/usr/bin/g++-${{ matrix.gcc_version }}'}" \
-o "*:shared=True" \
--build=missing
- name: Configure CMake
run: |
cmake -S . --preset=unixlike-gcc-debug \
-DCMAKE_C_COMPILER=gcc-${{ matrix.build_options.gcc_version }} \
-DCMAKE_CXX_COMPILER=g++-${{ matrix.build_options.gcc_version }} \
-DCMAKE_C_COMPILER=gcc-${{ matrix.gcc_version }} \
-DCMAKE_CXX_COMPILER=g++-${{ matrix.gcc_version }} \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DBUILD_TESTING:BOOL=ON \
-DUSE_SYSTEM_DEPENDENCIES:BOOL=${{ matrix.build_options.use_system_deps }} \
-DCMAKE_TOOLCHAIN_FILE=${{ matrix.build_options.toolchain_file }} \
-DUSE_STD_FORMAT:BOOL=ON \
-DUSE_SYSTEM_DEPENDENCIES:BOOL=ON \
-DCMAKE_TOOLCHAIN_FILE=build/Debug/generators/conan_toolchain.cmake \
-DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=gold
- name: Build
Expand Down
Loading

0 comments on commit e644411

Please sign in to comment.