Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions .github/workflows/build_dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Conan Build

on:
workflow_call:
inputs:
branch:
required: true
type: string
build-type:
required: true
type: string
malloc-impl:
required: true
type: string

jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: "3.8"

- name: Install Conan
run: |
python -m pip install --upgrade pip
python -m pip install conan~=1.0
conan user
conan profile new --detect default
# Set std::string to non-CoW C++11 version
sed -i 's,compiler.libcxx=libstdc++$,compiler.libcxx=libstdc++11,g' ~/.conan/profiles/default

- name: Retrieve Dependencies
uses: actions/checkout@v3
with:
repository: ebay/sisl
path: deps/sisl
ref: ${{ inputs.branch }}

- name: Restore Sisl 3rdParty Cache
id: restore-cache-sisl
uses: actions/cache/restore@v3
with:
path: |
~/.conan/data/folly
~/.conan/data/gperftools
~/.conan/data/jemalloc
~/.conan/data/prerelease_dummy
~/.conan/data/spdlog
key: SislDeps-${{ inputs.build-type }}-${{ inputs.malloc-impl }}

- name: Install Dependencies
run: |
conan export deps/sisl/3rd_party/gperftools
conan export deps/sisl/3rd_party/jemalloc
conan export deps/sisl/3rd_party/prerelease_dummy
conan install \
-o prerelease=True \
-o malloc_impl=${{ inputs.malloc-impl }} \
-s build_type=${{ inputs.build-type }} \
--build missing deps/sisl

- name: Cleanup dep builds
run: |
rm -rf ~/.conan/data/*/*/*/*/build

- name: Save Sisl 3rdParty Cache
id: save-cache-sisl
uses: actions/cache/save@v3
with:
path: |
~/.conan/data/folly
~/.conan/data/gperftools
~/.conan/data/jemalloc
~/.conan/data/prerelease_dummy
~/.conan/data/spdlog
key: SislDeps-${{ inputs.build-type }}-${{ inputs.malloc-impl }}
68 changes: 30 additions & 38 deletions .github/workflows/build_with_conan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,32 @@ on:
push:
branches:
- master
- 'stable/v*'
pull_request:
branches:
- master
- 'stable/v*'

#env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
#BUILD_TYPE: Release

jobs:
build_deps:
strategy:
fail-fast: false
matrix:
build-type: ["Debug", "Release"]
malloc-impl: ["libc", "tcmalloc", "jemalloc"]
exclude:
- build-type: Debug
malloc-impl: tcmalloc
- build-type: Debug
malloc-impl: jemalloc
- build-type: Release
malloc-impl: libc
uses: ./.github/workflows/build_dependencies.yml
with:
branch: master
build-type: ${{ matrix.build-type }}
malloc-impl: ${{ matrix.malloc-impl }}

build:
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
needs: build_deps
runs-on: ubuntu-22.04
strategy:
fail-fast: false
Expand All @@ -37,13 +48,11 @@ jobs:
malloc-impl: jemalloc
- build-type: Release
malloc-impl: libc
# - build-type: Release
# sanitize: "True"
- prerelease: "True"
malloc-impl: jemalloc

steps:
- name: Set up Python
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: "3.8"
Expand All @@ -52,49 +61,32 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install conan~=1.0

- name: Configure Conan
# Configure conan profiles for build runner
run: |
conan user
conan profile new --detect default
# Set std::string to non-CoW C++11 version
sed -i 's,compiler.libcxx=libstdc++$,compiler.libcxx=libstdc++11,g' ~/.conan/profiles/default

- name: Checkout Code
uses: actions/checkout@v3

- name: Cache 3rdParty
id: cache-3rd-party
uses: actions/cache@v3
- name: Restore Sisl 3rdParty Cache
id: restore-cache-sisl
uses: actions/cache/restore@v3
with:
path: |
~/.conan/data/folly
~/.conan/data/gperftools
~/.conan/data/jemalloc
~/.conan/data/prerelease_dummy
~/.conan/data/spdlog
key: ${{ matrix.build-type }}-${{ matrix.malloc-impl }}
key: SislDeps-${{ matrix.build-type }}-${{ matrix.malloc-impl }}

- name: Export Dependencies
run: |
conan export 3rd_party/gperftools
conan export 3rd_party/jemalloc
conan export 3rd_party/prerelease_dummy
- name: Checkout Code
uses: actions/checkout@v3

- name: Install dependencies
- name: Build
# Build your program with the given configuration
run: |
conan install \
-o prerelease=${{ matrix.prerelease }} \
-o malloc_impl=${{ matrix.malloc-impl }} \
-s build_type=${{ matrix.build-type }} \
--build missing .
#-o sanitize=${{ matrix.sanitize }} \

- name: Cleanup dep builds
run: |
rm -rf ~/.conan/data/*/*/*/*/build

- name: Build
# Build your program with the given configuration
run: |
conan build .