Skip to content

Commit

Permalink
chore: Improve CI build (#2)
Browse files Browse the repository at this point in the history
* chore: Improve CI build

* chore: Improve CI build, fix make instruction

* chore: Remove build.zip

* chore: Remove build.zip

* chore: Add run id to build artifact
  • Loading branch information
cronnosli authored Feb 20, 2023
1 parent a5a2c9d commit 892f256
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
27 changes: 25 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,44 @@ jobs:
run: |
echo "Installing dependencies"
sudo apt -y install nlohmann-json3-dev lcov libgtest-dev
shell: bash

- name: Build
run: |
echo "Build Application"
rm -Rf build
mkdir -p build
cd build
cmake ..
make
cmake .. -DENABLE_COVERAGE=ON
make VERBOSE=1
shell: bash

- name: Testing
run: |
echo "Making test"
cd build
make test
shell: bash

- name: Coverage
run: |
cd build
make coverage
shell: bash

- name: Generating artifacts
run: |
mkdir -p ${{github.workspace}}/artifacts/build-${{github.run_id}}
cp -r build/coverage ${{github.workspace}}/artifacts/build-${{github.run_id}}/
cp -r build/bin ${{github.workspace}}/artifacts/build-${{github.run_id}}/
cp -r build/Testing ${{github.workspace}}/artifacts/build-${{github.run_id}}/
shell: bash

- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
name: build-${{github.run_id}}
path: ${{github.workspace}}/artifacts/build-${{github.run_id}}/

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# Build artifacts
bin/
build/
build*

# Dependency files
vendor/
Expand Down
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.20)
cmake_minimum_required(VERSION 3.10)
project(cism)

set(CPACK_PACKAGE_CONTACT "[email protected]")
Expand All @@ -17,6 +17,8 @@ set(CPACK_DEBIAN_PACKAGE_SECTION "devel")
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
include(CPack)

option(ENABLE_COVERAGE "Set building for coverage, all optimizations will be disabled" OFF)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

Expand Down

0 comments on commit 892f256

Please sign in to comment.