Skip to content

Commit

Permalink
Use conan 2 for setting up (phbasler#124)
Browse files Browse the repository at this point in the history
* add basic setup with conan

* basic setup

* Add linux profiles

* Fix profiles

* add options to conan file

* trigger conan workflow

* only have toolchain in method

* fix typo in found

* run tests

* disable coverage by  default

* try matrix setup

* add other systems

* add profile

* add mac

* adjust compiler version

* adjust profile

* fix name

* adjust doxygen

* Adjust codeql

* add option to script

* remove unnecessary build

* install lcov through conan

* Automated commit of cmake-format changes.

* set options to empty list

* use elvis operator

* change name of matrix job

* adjust python notes

* fix indent

* add concurrency group

* Trigger on Setup change

* Fix option

* Fix missing s

* Install conan in wotkflow

* Update codecov.yml

* fix coverage exclusion

* Automated commit of cmake-format changes.

* add conan part to readme

* add codecov token

---------

Co-authored-by: Philipp Basler <[email protected]>
Co-authored-by: phbasler <[email protected]>
  • Loading branch information
3 people authored Apr 18, 2024
1 parent d02aa0a commit faee481
Show file tree
Hide file tree
Showing 38 changed files with 457 additions and 1,459 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
push:
branches: [master]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
benchmark:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/benchmark_on_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ on:
- '**.h'
- '**.hpp'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
PRbenchmark:
runs-on: ubuntu-latest
Expand Down
28 changes: 0 additions & 28 deletions .github/workflows/build-mac.yml

This file was deleted.

31 changes: 0 additions & 31 deletions .github/workflows/build.yml

This file was deleted.

37 changes: 0 additions & 37 deletions .github/workflows/build_on_windows.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .github/workflows/cmake-format-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
pull_request:
branches: [ master, develop ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
Expand Down
30 changes: 23 additions & 7 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,38 +12,54 @@ on:
- '**.c'
- '**.h'
- '**.hpp'
- '**CMakeLists.txt'
- 'conanfile.py'
pull_request:
branches: [ master, develop ]
paths:
- '**.cpp'
- '**.c'
- '**.h'
- '**.hpp'
- '**CMakeLists.txt'
- 'conanfile.py'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
coverage:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip-ci')"

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name : installPackages
run : sudo apt-get update && sudo apt-get install --no-install-recommends --yes libgsl-dev libeigen3-dev libnlopt-dev libnlopt-cxx-dev libboost-all-dev lcov
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v2
id: cpu-cores
- name: cmake
run: mkdir build && cd build && cmake .. -DEnableCoverage=On
- name : installPackages
run : sudo apt-get update && sudo apt-get install --no-install-recommends --yes lcov

- uses: actions/setup-python@v5
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Install conan
run: pip install conan>2
- run: python3 Setup.py --options EnableCoverage=True CompileBaryo=True UseVectorization=False
- run: cmake --preset conan-linux-x86_64-release
- name: compile
run: cd build && cmake --build . -j${{ steps.cpu-cores.outputs.count }}
run: cmake --build --preset conan-linux-x86_64-release -j${{ steps.cpu-cores.outputs.count }}
- name: Generate Coverage
run: cd build && cmake --build . -j${{ steps.cpu-cores.outputs.count }} -t coverage
run: cmake --build --preset conan-linux-x86_64-release -j${{ steps.cpu-cores.outputs.count }} -t coverage
- name: Upload coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.BSMPT_CODECOV_UPLOAD_TOKEN }}
flags: unittests # optional
name: codecov-umbrella # optional
fail_ci_if_error: true # optional (default = false)
Expand Down
25 changes: 17 additions & 8 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
schedule:
- cron: "14 17 * * 1"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
analyze:
name: Analyze
Expand Down Expand Up @@ -35,21 +39,26 @@ jobs:
queries: +security-and-quality
config-file: ./.github/codeql/codeql-config.yml

- name : installPackages
run : |
sudo apt-get update
sudo apt-get install --no-install-recommends --yes libgsl-dev libeigen3-dev libnlopt-dev libnlopt-cxx-dev libboost-all-dev
- uses: actions/setup-python@v5
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Install conan
run: pip install conan>2
if: matrix.language == 'cpp'

- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v2
id: cpu-cores
if: matrix.language == 'cpp'
- name: cmake
run: mkdir build && cd build && cmake .. -DUseLibCMAES=OFF
- name: Setup
run: python3 Setup.py --options CompileBaryo=True
if: matrix.language == 'cpp'
- name: Preset cmake
run: cmake --preset conan-linux-x86_64-release
if: matrix.language == 'cpp'
- name: make
run: cd build && cmake --build . -j${{ steps.cpu-cores.outputs.count }}
- name: build
run: cmake --build --preset conan-linux-x86_64-release -j${{ steps.cpu-cores.outputs.count }}
if: matrix.language == 'cpp'

- name: Autobuild
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/cpp-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
pull_request:
branches: [master]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
cpp-linter:
runs-on: ubuntu-latest
Expand Down
20 changes: 15 additions & 5 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,35 @@ on:
push:
branches: [ master ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true


jobs:
Deploy:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: installPackages
run: sudo apt-get install --no-install-recommends --yes libgsl-dev libeigen3-dev libnlopt-cxx-dev libboost-all-dev doxygen
run: sudo apt-get install --no-install-recommends --yes doxygen
- uses: actions/setup-python@v5
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Install conan
run: pip install conan>2
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v2
id: cpu-cores
- name: cmake
run: mkdir build && cd build && cmake .. && cmake --build . -j${{ steps.cpu-cores.outputs.count }} -t doc
- run: python3 Setup.py
- run: cmake --preset conan-linux-x86_64-release
- run: cmake --build --preset conan-linux-x86_64-release -j${{ steps.cpu-cores.outputs.count }} -t doc
- name: Deploy
uses: JamesIves/[email protected]
with:
branch: gh-pages # The branch the action should deploy to.
folder: build/html # The folder the action should deploy.
folder: build/linux-x86_64-release/html # The folder the action should deploy.
target-folder: documentation
55 changes: 0 additions & 55 deletions .github/workflows/test-mac.yml

This file was deleted.

Loading

0 comments on commit faee481

Please sign in to comment.