Skip to content

Commit

Permalink
Update matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
szmyd committed Aug 23, 2023
1 parent 19a01ff commit 0b43f61
Show file tree
Hide file tree
Showing 8 changed files with 111 additions and 122 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/build_commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ on:
prerelease:
required: true
type: string
tooling:
required: true
type: string

jobs:
SislDeps:
Expand All @@ -25,7 +28,9 @@ jobs:
build-type: ${{ inputs.build-type }}
malloc-impl: ${{ inputs.malloc-impl }}
prerelease: ${{ inputs.prerelease }}
tooling: None
if: ${{ github.event_name != 'pull_request' }}

NuRaftMesgDeps:
needs: SislDeps
uses: eBay/nuraft_mesg/.github/workflows/build_dependencies.yml@main
Expand All @@ -35,7 +40,9 @@ jobs:
build-type: ${{ inputs.build-type }}
malloc-impl: ${{ inputs.malloc-impl }}
prerelease: ${{ inputs.prerelease }}
tooling: None
if: ${{ github.event_name != 'pull_request' }}

IOMgrDeps:
needs: SislDeps
uses: eBay/iomanager/.github/workflows/build_dependencies.yml@master
Expand All @@ -45,7 +52,9 @@ jobs:
build-type: ${{ inputs.build-type }}
malloc-impl: ${{ inputs.malloc-impl }}
prerelease: ${{ inputs.prerelease }}
tooling: None
if: ${{ github.event_name != 'pull_request' }}

HomeStoreDeps:
needs: IOMgrDeps
uses: eBay/homestore/.github/workflows/build_dependencies.yml@master
Expand All @@ -56,6 +65,7 @@ jobs:
malloc-impl: ${{ inputs.malloc-impl }}
prerelease: ${{ inputs.prerelease }}
if: ${{ github.event_name != 'pull_request' }}

HomeReplDeps:
needs: [HomeStoreDeps, NuRaftMesgDeps]
uses: ./.github/workflows/build_dependencies.yml
Expand All @@ -65,8 +75,10 @@ jobs:
build-type: ${{ inputs.build-type }}
malloc-impl: ${{ inputs.malloc-impl }}
prerelease: ${{ inputs.prerelease }}
tooling: ${{ inputs.tooling }}
testing: 'True'
if: ${{ github.event_name != 'pull_request' }}

HomeReplBuild:
uses: ./.github/workflows/build_dependencies.yml
with:
Expand All @@ -75,5 +87,6 @@ jobs:
build-type: ${{ inputs.build-type }}
malloc-impl: ${{ inputs.malloc-impl }}
prerelease: ${{ inputs.prerelease }}
tooling: ${{ inputs.tooling }}
testing: 'True'
if: ${{ github.event_name == 'pull_request' }}
51 changes: 31 additions & 20 deletions .github/workflows/build_dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ on:
prerelease:
required: true
type: string
tooling:
required: false
type: string
default: 'None'
testing:
required: false
type: string
Expand Down Expand Up @@ -60,6 +64,13 @@ on:
- 'True'
- 'False'
default: 'False'
tooling:
required: false
type: choice
- 'Sanitize'
- 'Coverage'
- 'None'
default: 'None'
testing:
description: 'Build and Run'
required: true
Expand Down Expand Up @@ -166,6 +177,7 @@ jobs:
-o iomgr:testing=off \
-o homestore:testing=off \
-o nuraft_mesg:testing=False \
-o testing=False\
-s build_type=${{ inputs.build-type }} \
--build missing \
.
Expand Down Expand Up @@ -209,44 +221,43 @@ jobs:
fail_on_cache_miss: true
if: ${{ inputs.testing == 'True' && github.event_name != 'pull_request' && steps.restore-cache.outputs.cache-hit != 'true' }}

- name: Code Coverage Run
- name: Create and Test Package
run: |
conan install \
sanitize=$([[ "${{ inputs.tooling }}" == "Sanitize" ]] && echo "True" || echo "False")
conan create \
-o sisl:prerelease=${{ inputs.prerelease }} \
-o sisl:malloc_impl=${{ inputs.malloc-impl }} \
-o sisl:testing=False \
-o iomgr:testing=off \
-o homestore:testing=off \
-o nuraft_mesg:testing=False \
-o coverage=True \
-o home_replication:testing=True \
-o home_replication:sanitize=${sanitize} \
-s build_type=${{ inputs.build-type }} \
--build missing \
.
conan build .
if: ${{ inputs.testing == 'True' && inputs.platform == 'ubuntu-22.04' && inputs.build-type == 'Debug' && inputs.malloc-impl == 'libc' && inputs.prerelease == 'False' }}

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
gcov: true
if: ${{ inputs.testing == 'True' && inputs.platform == 'ubuntu-22.04' && inputs.build-type == 'Debug' && inputs.malloc-impl == 'libc' && inputs.prerelease == 'False' }}
if: ${{ inputs.testing == 'True' && inputs.tooling != 'Coverage' }}

- name: Create and Test Package
- name: Code Coverage Run
run: |
sanitize=$([[ "${{ inputs.build-type }}" == "Debug" && \
"${{ inputs.malloc-impl }}" == "libc" && \
"${{ inputs.prerelease }}" == "True" ]] && \
echo "True" || echo "False")
conan create \
conan install \
-o sisl:prerelease=${{ inputs.prerelease }} \
-o sisl:malloc_impl=${{ inputs.malloc-impl }} \
-o sisl:testing=False \
-o iomgr:testing=off \
-o homestore:testing=off \
-o nuraft_mesg:testing=False \
-o home_replication:sanitize=${sanitize} \
-o coverage=True \
-o testing=True \
-s build_type=${{ inputs.build-type }} \
--build missing \
.
if: ${{ inputs.testing == 'True' && ( inputs.platform != 'ubuntu-22.04' || inputs.build-type != 'Debug' || inputs.malloc-impl != 'libc' || inputs.prerelease != 'False' ) }}
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' }}
54 changes: 54 additions & 0 deletions .github/workflows/conan_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: HomeReplication Build

on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
Build:
strategy:
fail-fast: false
matrix:
platform: ["ubuntu-22.04"]
build-type: ["Debug", "Release"]
malloc-impl: ["libc", "tcmalloc"]
prerelease: ["True", "False"]
tooling: ["Sanitize", "Coverage", "None"]
exclude:
- build-type: Debug
prerelease: "False"
- build-type: Debug
tooling: None
- build-type: Debug
malloc-impl: tcmalloc
- build-type: Release
malloc-impl: libc
- build-type: Release
tooling: Sanitize
- build-type: Release
tooling: Coverage
uses: ./.github/workflows/build_commit.yml
with:
platform: ${{ matrix.platform }}
build-type: ${{ matrix.build-type }}
malloc-impl: ${{ matrix.malloc-impl }}
prerelease: ${{ matrix.prerelease }}
tooling: ${{ matrix.tooling }}
ChainBuild:
runs-on: "ubuntu-22.04"
steps:
- name: Start HomeObject Build
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.CHAIN_BUILD_TOKEN }}"\
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/eBay/homeobject/actions/workflows/conan_build.yml/dispatches \
-d '{"ref":"main","inputs":{}}'
if: ${{ github.ref == 'refs/heads/master' }}
23 changes: 0 additions & 23 deletions .github/workflows/merge_conan_build.yml

This file was deleted.

22 changes: 0 additions & 22 deletions .github/workflows/pr_conan_build.yml

This file was deleted.

54 changes: 6 additions & 48 deletions .jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pipeline {
}

stages {
stage('Adjust Tag for Master/PR') {
stage('Adjust Tag for Main/PR') {
when { not {
branch "${STABLE_BRANCH}"
} }
Expand Down Expand Up @@ -52,55 +52,13 @@ pipeline {
}
}

/* Commented out until unit tests are available
stage('Coverage') {
when { not {
branch "${STABLE_BRANCH}"
} }
stages {
stage("Adjust Sonar Branch") {
when {
not {
branch "${TARGET_BRANCH}"
}
}
steps {
sh "echo \"sonar.branch.target=${TARGET_BRANCH}\" >> sonar-project.properties"
}
}
stage("Code Coverage") {
steps {
slackSend channel: '#sds-ci', message: "*${PROJECT}:${TAG}* is undergoing Code Coverage."
sh "echo \"sonar.branch.name=${BRANCH_NAME}\" >> sonar-project.properties"
sh "conan install -o sisl:prerelease=True -pr debug ${BUILD_MISSING} -o ${PROJECT}:coverage=True ."
sh "build-wrapper-linux-x86-64 --out-dir /tmp/sonar conan build ."
sh "find . -name \"*.gcno\" -exec gcov {} \\;"
withSonarQubeEnv('sds-sonar') {
sh "sonar-scanner -Dsonar.projectBaseDir=. -Dsonar.projectVersion=\"${VER}\""
}
}
}
stage("Quality Gate") {
steps {
timeout(time: 5, unit: 'MINUTES') {
waitForQualityGate abortPipeline: false
}
}
}
}
}
*/

stage("Compile") {
steps {
/* Need some additional variants from homestore and iomgr to build this.
sh "conan create ${BUILD_MISSING} -o sisl:prerelease=False -o ${PROJECT}:sanitize=True -pr debug . ${PROJECT}/${TAG}"
sh "conan remove -f ${PROJECT}/${TAG}"
*/
sh "conan create ${BUILD_MISSING} -o sisl:prerelease=True -pr debug . ${PROJECT}/${TAG}"
sh "conan create ${BUILD_MISSING} -o sisl:prerelease=True -pr test . ${PROJECT}/${TAG}"
sh "conan create ${BUILD_MISSING} -o sisl:prerelease=False -pr test . ${PROJECT}/${TAG}"
sh "conan create ${BUILD_MISSING} -pr debug -o ${PROJECT}:sanitize=True . ${PROJECT}/${TAG} ; \
conan create ${BUILD_MISSING} -pr debug . ${PROJECT}/${TAG} ; \
conan create ${BUILD_MISSING} -pr test -o sisl:malloc_impl=tcmalloc . ${PROJECT}/${TAG} ; \
conan create ${BUILD_MISSING} -pr test -o sisl:prerelease=True -o sisl:malloc_impl=tcmalloc . ${PROJECT}/${TAG} ; \
"
}
}

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# HomeReplication
[![Conan Build](https://github.com/eBay/HomeReplication/actions/workflows/merge_conan_build.yml/badge.svg?branch=main)](https://github.com/eBay/HomeReplication/actions/workflows/merge_conan_build.yml)
[![Conan Build](https://github.com/eBay/HomeReplication/actions/workflows/conan_build.yml/badge.svg?branch=main)](https://github.com/eBay/HomeReplication/actions/workflows/conan_build.yml)
[![CodeCov](https://codecov.io/gh/eBay/HomeReplication/branch/main/graph/badge.svg)](https://codecov.io/gh/eBay/HomeReplication)

Replicated messaging service built upon HomeStore and NuRaft
Expand Down
14 changes: 6 additions & 8 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,14 @@ class HomeReplicationConan(ConanFile):
'fPIC': True,
'coverage': False,
'sanitize': False,
'testing': False,
'sisl:prerelease': True,
'testing': True,
}

generators = "cmake", "cmake_find_package"
exports_sources = ("CMakeLists.txt", "cmake/*", "src/*", "LICENSE")

def build_requirements(self):
self.build_requires("gtest/1.13.0")
self.build_requires("gtest/1.14.0")

def requirements(self):
self.requires("nuraft_mesg/[~=1, include_prerelease=True]@oss/main")
Expand All @@ -49,18 +48,17 @@ def validate(self):
if self.info.settings.os in ["Macos", "Windows"]:
raise ConanInvalidConfiguration("{} Builds are unsupported".format(self.info.settings.os))
if self.info.settings.compiler.cppstd:
check_min_cppstd(self, 11)
check_min_cppstd(self, 20)

def configure(self):
if self.options.shared:
del self.options.fPIC
if self.settings.build_type == "Debug":
if self.options.coverage and self.options.sanitize:
raise ConanInvalidConfiguration("Sanitizer does not work with Code Coverage!")
if self.options.sanitize:
self.options['sisl'].malloc_impl = 'libc'
if self.options.coverage:
self.options.testing = True
if not self.options.testing:
if self.options.coverage or self.options.sanitize:
raise ConanInvalidConfiguration("Coverage/Sanitizer requires Testing!")

def build(self):
definitions = {
Expand Down

0 comments on commit 0b43f61

Please sign in to comment.