Skip to content

Commit

Permalink
Update dependencies, fix readme example (#58)
Browse files Browse the repository at this point in the history
* update dependencies, namespace targets and activate cmake format

* fix valgrind install

* merge envs
  • Loading branch information
TheLartians committed Jan 21, 2021
1 parent 0978415 commit f5788b6
Show file tree
Hide file tree
Showing 16 changed files with 317 additions and 526 deletions.
57 changes: 57 additions & 0 deletions .cmake-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
format:
tab_size: 2
line_width: 100
dangle_parens: true

parse:
additional_commands:
cpmaddpackage:
pargs:
nargs: '*'
flags: []
spelling: CPMAddPackage
kwargs: &cpmaddpackagekwargs
NAME: 1
FORCE: 1
VERSION: 1
GIT_TAG: 1
DOWNLOAD_ONLY: 1
GITHUB_REPOSITORY: 1
GITLAB_REPOSITORY: 1
GIT_REPOSITORY: 1
SVN_REPOSITORY: 1
SVN_REVISION: 1
SOURCE_DIR: 1
DOWNLOAD_COMMAND: 1
FIND_PACKAGE_ARGUMENTS: 1
NO_CACHE: 1
GIT_SHALLOW: 1
URL: 1
URL_HASH: 1
URL_MD5: 1
DOWNLOAD_NAME: 1
DOWNLOAD_NO_EXTRACT: 1
HTTP_USERNAME: 1
HTTP_PASSWORD: 1
OPTIONS: +
cpmfindpackage:
pargs:
nargs: '*'
flags: []
spelling: CPMFindPackage
kwargs: *cpmaddpackagekwargs
packageproject:
pargs:
nargs: '*'
flags: []
spelling: packageProject
kwargs:
NAME: 1
VERSION: 1
NAMESPACE: 1
INCLUDE_DIR: 1
INCLUDE_DESTINATION: 1
BINARY_DIR: 1
COMPATIBILITY: 1
VERSION_HEADER: 1
DEPENDENCIES: +
17 changes: 11 additions & 6 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,22 @@ on:
env:
CTEST_OUTPUT_ON_FAILURE: 1
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1

- uses: actions/checkout@v2

- uses: actions/cache@v2
with:
path: "**/cpm_modules"
key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}

- name: configure
run: cmake -Hexample -Bbuild
run: cmake -Sexample -Bbuild

- name: build
run: cmake --build build -j4
45 changes: 25 additions & 20 deletions .github/workflows/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,33 @@ on:

env:
CTEST_OUTPUT_ON_FAILURE: 1
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1

- name: build and install library
run: |
CXX=g++-9 cmake -Hglue -Bbuild -DCMAKE_BUILD_TYPE=Release
sudo cmake --build build --target install
rm -rf build
- name: configure
run: CXX=g++-9 cmake -Htest -Bbuild -DTEST_INSTALLED_VERSION=1

- name: build
run: cmake --build build --config Debug -j4

- name: test
run: |
cd build
ctest --build-config Debug
- uses: actions/checkout@v2

- uses: actions/cache@v2
with:
path: "**/cpm_modules"
key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}

- name: build and install library
run: |
CXX=g++-9 cmake -Sglue -Bbuild -DCMAKE_BUILD_TYPE=Release
sudo cmake --build build --target install
rm -rf build
- name: configure
run: CXX=g++-9 cmake -Stest -Bbuild -DTEST_INSTALLED_VERSION=1

- name: build
run: cmake --build build --config Debug -j4

- name: test
run: |
cd build
ctest --build-config Debug
33 changes: 19 additions & 14 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,27 @@ on:

env:
CTEST_OUTPUT_ON_FAILURE: 1
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules

jobs:
build:

runs-on: macos-latest

steps:
- uses: actions/checkout@v1

- name: configure
run: cmake -Htest -Bbuild

- name: build
run: cmake --build build --config Debug -j4

- name: test
run: |
cd build
ctest --build-config Debug
- uses: actions/checkout@v2

- uses: actions/cache@v2
with:
path: "**/cpm_modules"
key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}

- name: configure
run: cmake -Stest -Bbuild

- name: build
run: cmake --build build --config Debug -j4

- name: test
run: |
cd build
ctest --build-config Debug
29 changes: 19 additions & 10 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,28 @@ on:
branches:
- master

env:
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules

jobs:
build:

runs-on: macos-latest

steps:
- uses: actions/checkout@v1

- name: Install clang-format
run: brew install clang-format
- uses: actions/checkout@v2

- uses: actions/cache@v2
with:
path: "**/cpm_modules"
key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}

- name: Install format dependencies
run: |
brew install clang-format
pip3 install cmake_format==0.6.11 pyyaml
- name: configure
run: cmake -Htest -Bbuild
- name: configure
run: cmake -Stest -Bbuild

- name: check style
run: cmake --build build --target check-format
- name: check style
run: cmake --build build --target check-format
89 changes: 48 additions & 41 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,49 +11,56 @@ on:
env:
CTEST_OUTPUT_ON_FAILURE: 1
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1

- name: install valgrind
run: sudo apt install -y valgrind

- name: configure
run: CXX=g++-8 cmake -Htest -Bbuild -DCMAKE_BUILD_TYPE=Debug

- name: build
run: cmake --build build -j4

- name: test
run: cmake --build build -j4

- name: run tests with valgrind
run: valgrind --track-origins=yes --error-exitcode=1 --leak-check=full ./build/PEGParserTests

- name: configure with code coverage
run: CXX=g++-8 cmake -Htest -Bbuild -DENABLE_TEST_COVERAGE=1

- name: build with code coverage
run: cmake --build build -j4

- name: test with code coverage
run: |
cd build
ctest --build-config Debug
- name: install code coverage tools
run: |
wget https://github.com/linux-test-project/lcov/releases/download/v1.14/lcov-1.14.tar.gz
tar xvfz lcov-1.14.tar.gz;
sudo make install -C lcov-1.14
- name: collect code coverage
run: |
lcov --gcov-tool $(which gcov-8) --directory . --capture --no-external --exclude "*tests*" --exclude "*_deps*" --quiet --output-file coverage.info
lcov --gcov-tool $(which gcov-8) --list coverage.info
bash <(curl -s https://codecov.io/bash) -f coverage.info || echo "Codecov did not collect coverage reports"
- uses: actions/checkout@v2

- uses: actions/cache@v2
with:
path: "**/cpm_modules"
key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}

- name: install valgrind
run: |
sudo apt-get update
sudo apt install -y valgrind
- name: configure
run: CXX=g++-8 cmake -Stest -Bbuild -DCMAKE_BUILD_TYPE=Debug

- name: build
run: cmake --build build -j4

- name: test
run: cmake --build build -j4

- name: run tests with valgrind
run: valgrind --track-origins=yes --error-exitcode=1 --leak-check=full ./build/PEGParserTests

- name: configure with code coverage
run: CXX=g++-8 cmake -Stest -Bbuild -DENABLE_TEST_COVERAGE=1

- name: build with code coverage
run: cmake --build build -j4

- name: test with code coverage
run: |
cd build
ctest --build-config Debug
- name: install code coverage tools
run: |
wget https://github.com/linux-test-project/lcov/releases/download/v1.14/lcov-1.14.tar.gz
tar xvfz lcov-1.14.tar.gz;
sudo make install -C lcov-1.14
- name: collect code coverage
run: |
lcov --gcov-tool $(which gcov-8) --directory . --capture --no-external --exclude "*tests*" --exclude "*_deps*" --quiet --output-file coverage.info
lcov --gcov-tool $(which gcov-8) --list coverage.info
bash <(curl -s https://codecov.io/bash) -f coverage.info || echo "Codecov did not collect coverage reports"
33 changes: 19 additions & 14 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,27 @@ on:

env:
CTEST_OUTPUT_ON_FAILURE: 1
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules

jobs:
build:

runs-on: windows-latest

steps:
- uses: actions/checkout@v1

- name: configure
run: cmake -Htest -Bbuild

- name: build
run: cmake --build build --config Debug -j4

- name: test
run: |
cd build
ctest --build-config Debug
- uses: actions/checkout@v2

- uses: actions/cache@v2
with:
path: "**/cpm_modules"
key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}

- name: configure
run: cmake -Stest -Bbuild

- name: build
run: cmake --build build --config Debug -j4

- name: test
run: |
cd build
ctest --build-config Debug
Loading

0 comments on commit f5788b6

Please sign in to comment.