Skip to content

Commit

Permalink
Merge branch 'eBay:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
hkadayam authored Feb 4, 2024
2 parents 5b2c6c5 + 6dec7cd commit e24b2d6
Show file tree
Hide file tree
Showing 199 changed files with 10,094 additions and 4,766 deletions.
1 change: 0 additions & 1 deletion src/.clang-format → .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ AlignOperands: false
AlignTrailingComments: true
AllowShortBlocksOnASingleLine: true
AllowShortIfStatementsOnASingleLine: true
AllowShortBlocksOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: false
# AllowShortFunctionsOnASingleLine: InlineOnly
# AllowShortLoopsOnASingleLine: false
Expand Down
89 changes: 89 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
codecov:
notify:
require_ci_to_pass: no

ignore:
- "**/*_test.c*"
- "**/*_test.h*"
- "**/*_generated.h"
- "**/*_pb.cc"
- "**/*_pb.h"
- "**/test*/*.c*"
- "**/test*/*.h*"
- "**/*test_flip.*"
- "**/grpc/tests/**"

comment:
layout: "header, diff, flags, components"

component_management:
default_rules:
statuses:
- type: project
target: auto
individual_components:
- component_id: modules_auth_manager
name: AuthManager
paths:
- src/auth_manager/**
- include/sisl/auth_manager/**
- component_id: modules_cache
name: Cache
paths:
- src/cache/**
- include/sisl/cache/**
- component_id: modules_fds
name: FDS
paths:
- src/fds/**
- include/sisl/fds/**
- component_id: modules_file_watcher
name: FileWatcher
paths:
- src/file_watcher/**
- include/sisl/file_watcher/**
- component_id: modules_flip
name: Flip
paths:
- src/flip/**
- include/sisl/flip/**
- component_id: modules_grpc
name: gRPC
paths:
- src/grpc/**
- include/sisl/grpc/**
- component_id: modules_logging
name: Logging
paths:
- src/logging/**
- include/sisl/logging/**
- component_id: modules_metrics
name: Metrics
paths:
- src/metrics/**
- include/sisl/metrics/**
- component_id: modules_options
name: Options
paths:
- src/options/**
- include/sisl/options/**
- component_id: modules_settings
name: Setting
paths:
- src/settings/**
- include/sisl/settings/**
- component_id: modules_sobject
name: StatusObject
paths:
- src/sobject/**
- include/sisl/sobject/**
- component_id: modules_version
name: Utility
paths:
- src/utility/**
- include/sisl/utility/**
- component_id: modules_version
name: Version
paths:
- src/version/**
- include/sisl/version.hpp
57 changes: 57 additions & 0 deletions .github/actions/load_conan/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: 'Load Conan Cache'
description: 'Loads Local Conan Cache'
inputs:
testing:
description: 'Support building tests'
required: true
key_prefix:
description: 'Cache prefix'
required: true
default: 'Deps'
fail_on_cache_miss:
description: 'Fail if key missing'
required: false
default: false
path:
description: 'Recipe path'
required: false
default: '.'
load_any:
description: 'Load cache miss'
required: false
default: 'False'
outputs:
cache-hit:
description: 'Cache match found'
value: ${{ steps.restore-cache.outputs.cache-hit }}
runs:
using: "composite"
steps:
- id: hash-key-primary
shell: bash
run: |
echo "key=${{ inputs.path }}/conanfile.py" >> $GITHUB_OUTPUT
- id: hash-key-3rd
shell: bash
run: |
echo "keys=${{ inputs.path }}/3rd_party/**/conanfile.py" >> $GITHUB_OUTPUT
- name: Restore Cache
id: restore-cache
uses: actions/cache/restore@v3
with:
path: |
~/.conan/data
key: ${{ inputs.key_prefix }}-${{ hashFiles(steps.hash-key-primary.outputs.key, steps.hash-key-3rd.outputs.keys) }}
fail-on-cache-miss: ${{ inputs.fail_on_cache_miss }}

- name: Restore Testing Cache
uses: actions/cache/restore@v3
with:
path: |
~/.conan/data
key: ${{ inputs.key_prefix }}-${{ hashFiles(steps.hash-key-primary.outputs.key, steps.hash-key-3rd.outputs.keys) }}
restore-keys: ${{ inputs.key_prefix }}-
if: ${{ steps.restore-cache.outputs.cache-hit != 'true' && (( github.event_name == 'pull_request' && inputs.testing == 'True' ) || ( inputs.load_any == 'True' )) }}

31 changes: 31 additions & 0 deletions .github/actions/setup_conan/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: 'Setup Conan'
description: 'Sets up Conan for Sisl Builds'
inputs:
platform:
description: 'Platform conan will be building on'
required: true
default: 'ubuntu-22.04'
runs:
using: "composite"
steps:
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: "3.8"

- name: Setup Conan and Export Recipes
shell: bash
run: |
python -m pip install --upgrade pip
python -m pip install conan~=1.0
python -m pip install gcovr
conan user
conan profile new --detect default
- name: Fixup libstdc++
shell: bash
run: |
# Set std::string to non-CoW C++11 version
sed -i 's,compiler.libcxx=libstdc++$,compiler.libcxx=libstdc++11,g' ~/.conan/profiles/default
if: ${{ inputs.platform == 'ubuntu-22.04' }}

36 changes: 36 additions & 0 deletions .github/actions/store_conan/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: 'Store Conan Cache'
description: 'Cleans Local Conan Cache and Persists Dirty Packages'
inputs:
key_prefix:
description: 'Cache prefix'
required: true
default: 'Deps'
runs:
using: "composite"
steps:
- name: Setup Conan and Export Recipes
shell: bash
run: |
if [ -d 3rd_party ]; then
dep_pkgs=$(ls -1d 3rd_party/* 2>/dev/null | cut -d'/' -f2 | paste -sd'|' - -)
fi
if [ -z "${dep_pkgs}" ]; then
dep_pkgs="no_3rd_party"
fi
dirty_pkgs=$(ls -1d ~/.conan/data/*/*/*/*/build 2>/dev/null | sed 's,.*data/,,')
if [ -z "${dirty_pkgs}" ]; then
dirty_pkgs="no_public/0"
fi
dirty_pkgs_d=$(echo "${dirty_pkgs}" | cut -d'/' -f1 | paste -sd'|' - -)
echo "::info:: Caching: ${dirty_pkgs_d}|${dep_pkgs}"
ls -1d ~/.conan/data/* | grep -Ev "(${dirty_pkgs_d}|${dep_pkgs})" | xargs rm -rf
rm -rf ~/.conan/data/*/*/*/*/build
rm -rf ~/.conan/data/*/*/*/*/source
- name: Save Cache
uses: actions/cache/save@v3
with:
path: |
~/.conan/data
key: ${{ inputs.key_prefix }}-${{ hashFiles('conanfile.py', '3rd_party/**/conanfile.py') }}

166 changes: 166 additions & 0 deletions .github/workflows/build_dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
name: Conan Build

on:
workflow_call:
inputs:
platform:
required: false
default: 'ubuntu-22.04'
type: string
branch:
required: true
type: string
build-type:
required: true
type: string
malloc-impl:
required: true
type: string
prerelease:
required: false
type: string
default: 'False'
tooling:
required: false
type: string
default: 'None'
testing:
required: false
type: string
default: 'False'
workflow_dispatch:
inputs:
platform:
required: true
type: choice
options:
- ubuntu-22.04
- ubuntu-20.04
- macos-13
- macos-12
default: 'ubuntu-22.04'
branch:
required: true
type: string
build-type:
required: true
type: choice
options:
- Debug
- Release
- RelWithDebInfo
malloc-impl:
description: 'Allocation Library'
required: true
type: choice
options:
- libc
- tcmalloc
- jemalloc
prerelease:
description: 'Fault Instrumentation'
required: false
type: choice
options:
- 'True'
- 'False'
default: 'False'
tooling:
required: false
type: choice
- 'Sanitize'
- 'Coverage'
- 'None'
default: 'None'
testing:
description: 'Build and Run'
required: true
type: choice
options:
- 'True'
- 'False'
default: 'True'

jobs:
BuildSislDeps:
runs-on: ${{ inputs.platform }}
steps:
- name: Retrieve Code
uses: actions/checkout@v3
with:
ref: ${{ inputs.branch }}
if: ${{ inputs.testing == 'True' }}

- name: Retrieve Recipe
uses: actions/checkout@v3
with:
repository: eBay/sisl
ref: ${{ inputs.branch }}
if: ${{ inputs.testing == 'False' }}

- name: Load Conan Cache
id: restore-cache
uses: eBay/sisl/.github/actions/load_conan@stable/v8.x
with:
testing: ${{ inputs.testing }}
key_prefix: SislDeps-${{ inputs.platform }}-${{ inputs.build-type }}-${{ inputs.malloc-impl }}-${{ inputs.prerelease }}

- name: Setup Conan
uses: eBay/sisl/.github/actions/setup_conan@stable/v8.x
with:
platform: ${{ inputs.platform }}
if: ${{ inputs.testing == 'True' || steps.restore-cache.outputs.cache-hit != 'true' }}

- name: Prepare Recipes
run: |
./prepare.sh
cached_pkgs=$(ls -1d ~/.conan/data/*/*/*/*/export 2>/dev/null | sed 's,.*data/,,' | cut -d'/' -f1,2 | paste -sd',' - -)
echo "::info:: Pre-cached: ${cached_pkgs}"
if: ${{ inputs.testing == 'True' || steps.restore-cache.outputs.cache-hit != 'true' }}

- name: Build Cache
run: |
conan install \
-o prerelease=${{ inputs.prerelease }} \
-o malloc_impl=${{ inputs.malloc-impl }} \
-s build_type=${{ inputs.build-type }} \
--build missing \
.
if: ${{ steps.restore-cache.outputs.cache-hit != 'true' }}

- name: Save Conan Cache
uses: eBay/sisl/.github/actions/store_conan@stable/v8.x
with:
key_prefix: SislDeps-${{ inputs.platform }}-${{ inputs.build-type }}-${{ inputs.malloc-impl }}-${{ inputs.prerelease }}
if: ${{ github.event_name != 'pull_request' && steps.restore-cache.outputs.cache-hit != 'true' }}

- name: Create and Test Package
run: |
sanitize=$([[ "${{ inputs.tooling }}" == "Sanitize" ]] && echo "True" || echo "False")
conan create \
-o sisl:prerelease=${{ inputs.prerelease }} \
-o sisl:malloc_impl=${{ inputs.malloc-impl }} \
-o sisl:sanitize=${sanitize} \
-s build_type=${{ inputs.build-type }} \
--build missing \
.
if: ${{ inputs.testing == 'True' && inputs.tooling != 'Coverage' }}

- name: Code Coverage Run
run: |
conan install \
-o prerelease=${{ inputs.prerelease }} \
-o malloc_impl=${{ inputs.malloc-impl }} \
-o coverage=True \
-s build_type=${{ inputs.build-type }} \
--build missing \
.
conan build .
if: ${{ inputs.testing == 'True' && inputs.tooling == 'Coverage' }}

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
gcov: true
if: ${{ inputs.testing == 'True' && inputs.tooling == 'Coverage' }}
Loading

0 comments on commit e24b2d6

Please sign in to comment.