Skip to content

Instantly share code, notes, and snippets.

@Ben1980
Last active April 14, 2020 19:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ben1980/79cd1e9e8c9d0b8dba2b00644ef6e6bc to your computer and use it in GitHub Desktop.
Save Ben1980/79cd1e9e8c9d0b8dba2b00644ef6e6bc to your computer and use it in GitHub Desktop.
circleci configuration
version: 2.1
executors: #(1)
exectr:
docker:
- image: dockerben/cpptemplate:latest #(2)
jobs:
build:
executor: exectr #(1)
steps:
- checkout
- run:
name: Install vcpkg dependencies
command: ./../../vcpkg/vcpkg install fmt doctest #(3)
- run:
name: Create build directories
command: |
mkdir -p build
mv buildutils build/buildutils
- run:
name: Setup cmake and build artifacts
command: |
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=/vcpkg/scripts/buildsystems/vcpkg.cmake .. #(4)
cmake --build . --config Release #(5)
- persist_to_workspace: #(6)
root: .
paths: build
test:
executor: exectr #(1)
steps:
- attach_workspace: #(7)
at: .
- run:
name: Create test directory
command: |
cd build
mkdir -p Test
- run:
name: Execute Tests
command: |
cd build
ctest --no-compress-output -T Test || true #(8)
- run:
name: Transform test results into JUnit conform notation
command: |
python3 build/buildutils/ctest2JUnit.py build build/buildutils/CTest2JUnit.xsl > build/Test/results.xml #(9)
- store_test_results: #(10)
path: build/Test
workflows:
version: 2
build-and-test:
jobs:
- build #(11)
- test: #(12)
requires:
- build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment