-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
185 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: 'Setup Conan2' | ||
description: 'Sets up Conan2 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 Conan2 | ||
shell: bash | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install conan~=2.0 | ||
python -m pip install gcovr | ||
conan profile detect --name 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' ~/.conan2/profiles/default | ||
if: ${{ inputs.platform == 'ubuntu-22.04' }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
name: Conan2 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 | ||
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 | ||
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: Setup Conan | ||
uses: eBay/sisl/.github/actions/setup_conan2@conan2 | ||
with: | ||
platform: ${{ inputs.platform }} | ||
if: ${{ inputs.testing == 'True' || steps.restore-cache.outputs.cache-hit != 'true' }} | ||
|
||
- name: Prepare Recipes | ||
run: | | ||
./prepare_v2.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: Create and Test Package | ||
run: | | ||
sanitize=$([[ "${{ inputs.tooling }}" == "Sanitize" ]] && echo "True" || echo "False") | ||
conan create \ | ||
-o sisl/*:malloc_impl=${{ inputs.malloc-impl }} \ | ||
-o sisl/*:sanitize=${sanitize} \ | ||
-s:h build_type=${{ inputs.build-type }} \ | ||
--build missing \ | ||
. | ||
if: ${{ inputs.testing == 'True' && inputs.tooling != 'Coverage' }} | ||
|
||
- name: Code Coverage Run | ||
run: | | ||
conan build | ||
-o sisl/*:malloc_impl=${{ inputs.malloc-impl }} \ | ||
-o sisl/*:coverage=True \ | ||
-s:h build_type=${{ inputs.build-type }} \ | ||
--build missing \ | ||
. | ||
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' }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters