Skip to content

Commit

Permalink
Merge pull request #64 from Klebert-Engineering/fetchcontent-find-pac…
Browse files Browse the repository at this point in the history
…kage

Use + Provide Conan Packages
  • Loading branch information
johannes-wolf authored Feb 21, 2024
2 parents 5b46c1a + 8a350dc commit 6405c9c
Show file tree
Hide file tree
Showing 26 changed files with 489 additions and 249 deletions.
62 changes: 29 additions & 33 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,31 @@ on:
branches: [ master, main ]
pull_request:
branches: [ '**' ]
paths-ignore:
- '**/*.md'
- '**/*.txt'

jobs:
build-linux:
name: Linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install gcovr ninja-build valgrind
- name: Setup
- name: Install Conan 2
run: |
mkdir build
- name: Configure
working-directory: build
run: |
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_EXPORT_COMPILE_COMMANDS=YES -GNinja ..
pip install conan
conan profile detect
- name: Build
working-directory: build
run: |
cmake --build .
mkdir build
conan install . -of build --build=missing -s compiler.cppstd=20
cmake . -B build -GNinja -DSIMFIL_FPIC=YES -DSIMFIL_SHARED=NO
cmake --build build
- name: Run CTest
working-directory: build/test
run: |
Expand Down Expand Up @@ -98,47 +99,42 @@ jobs:
name: Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup
run: |
mkdir build
- name: Configure
working-directory: build
- name: Install Conan 2
run: |
cmake ..
shell: cmd
pip install conan
conan profile detect
- name: Build
working-directory: build
run: |
cmake --build .
shell: cmd
mkdir build
conan install . -of build --build=missing -s compiler.cppstd=20
cmake . -B build -DSIMFIL_FPIC=NO -DSIMFIL_SHARED=NO
cmake --build build
- name: Run CTest
working-directory: build/test
run: |
ctest -C Debug --verbose
shell: cmd
ctest --verbose --output-junit result-junit.xml
build-macos:
name: MacOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup
run: |
mkdir build
- name: Configure
working-directory: build
- name: Install Conan 2
run: |
cmake ..
pip install conan
conan profile detect
- name: Build
working-directory: build
run: |
cmake --build .
mkdir build
conan install . -of build --build=missing -s compiler.cppstd=20
cmake . -B build -DSIMFIL_FPIC=YES -DSIMFIL_SHARED=NO
cmake --build build
- name: Run CTest
working-directory: build/test
run: |
ctest --verbose
ctest --verbose --output-junit result-junit.xml
51 changes: 0 additions & 51 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

43 changes: 43 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Scan
on:
push:
branches: [main, protected]
pull_request:
branches: [main]
paths-ignore:
- '**/*.md'
- '**/*.txt'
schedule:
- cron: '16 6 * * 0'

jobs:
analyze:
name: Analyze
runs-on: [ubuntu-latest]
permissions:
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
- uses: github/codeql-action/init@v3
with:
languages: c-cpp
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install ninja-build
- name: Install Conan 2
run: |
pip install conan
conan profile detect
- name: Build
run: |
mkdir build
conan install . -of build --build=missing -s compiler.cppstd=20
cmake . -B build -GNinja -DSIMFIL_FPIC=YES -DSIMFIL_SHARED=NO
cmake --build build
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: c-cpp
25 changes: 25 additions & 0 deletions .github/workflows/conan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Conan
on:
push:
branches: [ master, main ]
pull_request:
branches: [ '**' ]
paths-ignore:
- '**/*.md'
- '**/*.txt'

jobs:
package:
name: Package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install Conan 2
run: |
pip install conan
conan profile detect
- name: Create
run: |
conan create . -s compiler.cppstd=20 --build=missing
27 changes: 14 additions & 13 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,37 @@ on:
branches: [ master, main ]
pull_request:
branches: [ '**' ]
paths-ignore:
- '**/*.md'
- '**/*.txt'

jobs:
coverage-linux:
name: Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true
- name: Install dependencies
run: |
sudo apt-get install ninja-build
pip install gcovr
gcovr --version
- name: Setup
- name: Install Conan 2
run: |
mkdir build
- name: Configure
working-directory: build
run: |
cmake -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_EXPORT_COMPILE_COMMANDS=YES \
-DWITH_COVERAGE=YES -GNinja ..
pip install conan
conan profile detect
- name: Build
working-directory: build
run: |
cmake --build .
- name: Run Test
mkdir build
conan install . -of build --build=missing -s compiler.cppstd=20
cmake . -B build -DSIMFIL_WITH_COVERAGE=YES -DSIMFIL_WITH_TESTS=YES -DCMAKE_BUILD_TYPE=Debug -DSIMFIL_FPIC=YES -DSIMFIL_SHARED=NO -DSIMFIL_WITH_COVERAGE=YES -GNinja
cmake --build build
- name: Run CTest
working-directory: build/test
run: |
ctest
ctest --verbose --output-junit result-junit.xml
- name: Run Gcovr
run: |
mkdir coverage
Expand All @@ -44,6 +44,7 @@ jobs:
gcovr --cobertura coverage.xml \
--html coverage.html \
--filter src/ --filter include/
less coverage.xml
- name: Publish Coverage HTML
uses: actions/upload-artifact@v3
Expand Down
9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
.idea
.clang-format
cmake-build-debug/
cmake-build-release/
.cache
**/compile_commands.json
**/CMakeUserPresets.json
/cmake-build-debug/
/cmake-build-release/
/build/
/test_package/build/
Loading

0 comments on commit 6405c9c

Please sign in to comment.