Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions .github/actions/linux-build/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: "Linux Build"
description: "Build the C++ library on Linux."
description: "Build the C++ library on Linux. Produces artifact build-cpp-linux-$compiler-$version-$config."
inputs:
config:
description: "Configuration to build (Release or Debug, see CMAKE_BUILD_TYPE)"
Expand All @@ -14,19 +14,19 @@ inputs:
required: true
default: "latest"
optional-dependencies:
description: "Build the library with optional dependencies (ON or OFF)"
description: "Build the library with optional dependencies (ON or OFF, default ON). If OFF, adds `-nodep` to the artifact name"
required: false
default: "ON"
coverage:
description: "Turn coverage on (ON or OFF)"
description: "Turn coverage on (ON or OFF, default OFF)"
required: false
default: "OFF"
sanitize-ub:
description: "Turn on UB sanitzer (ON or OFF)"
description: "Turn on UB sanitzer (ON or OFF, default OFF)"
required: false
default: "OFF"
sanitize-addr:
description: "Turn on address sanitzer (ON or OFF)"
description: "Turn on address sanitzer (ON or OFF, default OFF)"
required: false
default: "OFF"
build-tests:
Expand All @@ -37,6 +37,10 @@ inputs:
description: "Build benchmarks"
required: false
default: "OFF"
openmp:
description: "Enable Multithreading with OpenMP (ON or OFF, default OFF). If ON, adds `-omp` to the name of the artifact."
required: false
default: "OFF"
runs:
using: "composite"
steps:
Expand Down Expand Up @@ -85,7 +89,7 @@ runs:
exit 1
fi
mkdir -p build && cd build
cmake -DCMAKE_BUILD_TYPE=${{ inputs.config }} -DMEMILIO_BUILD_TESTS=${{ inputs.build-tests }} -DMEMILIO_BUILD_BENCHMARKS=${{ inputs.build-benchmarks }} -DMEMILIO_TEST_COVERAGE=${{ inputs.coverage }} -DMEMILIO_SANITIZE_ADDRESS=${{ inputs.sanitize-addr }} -DMEMILIO_SANITIZE_UNDEFINED=${{ inputs.sanitize-ub }} -DMEMILIO_USE_BUNDLED_JSONCPP=${{ inputs.optional-dependencies }} ..
cmake -DCMAKE_BUILD_TYPE=${{ inputs.config }} -DMEMILIO_BUILD_TESTS=${{ inputs.build-tests }} -DMEMILIO_BUILD_BENCHMARKS=${{ inputs.build-benchmarks }} -DMEMILIO_TEST_COVERAGE=${{ inputs.coverage }} -DMEMILIO_SANITIZE_ADDRESS=${{ inputs.sanitize-addr }} -DMEMILIO_SANITIZE_UNDEFINED=${{ inputs.sanitize-ub }} -DMEMILIO_USE_BUNDLED_JSONCPP=${{ inputs.optional-dependencies }} -DMEMILIO_ENABLE_OPENMP=${{ inputs.openmp }} ..
make -j4
- name: create build dir archive
shell: bash
Expand All @@ -95,6 +99,7 @@ runs:
- name: Upload built directory
uses: actions/upload-artifact@v3
with:
name: build-cpp-linux-${{ inputs.compiler }}-${{ inputs.version }}-${{ inputs.config }}-${{ inputs.optional-dependencies == 'ON' && 'full' || 'part'}}
#artifacts in one pipeline must have a different name, so options must add a suffix to the artifact name if different values are used in the same pipeline
name: build-cpp-linux-${{ inputs.compiler }}-${{ inputs.version }}-${{ inputs.config }}${{ inputs.optional-dependencies == 'OFF' && '-nodep' || ''}}${{ inputs.openmp == 'ON' && '-omp' || ''}}
path: cpp/build.tar.gz
retention-days: 1
6 changes: 5 additions & 1 deletion .github/actions/linux-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ inputs:
description: "Create coverage report (ON or OFF)"
required: false
default: "OFF"
num-repeat:
description: "Repeat tests, e.g. to catch random failures like race conditions."
required: false
default: "1"
runs:
using: "composite"
steps:
Expand All @@ -34,7 +38,7 @@ runs:
run: |
cd cpp/build/bin
sudo chmod a+x memilio-test
./memilio-test --gtest_output="xml:report.xml"
./memilio-test --gtest_output="xml:report.xml" --gtest_repeat=${{ inputs.num-repeat }}
- name: Compute code coverage
shell: bash
# compute code coverage
Expand Down
7 changes: 4 additions & 3 deletions .github/actions/windows-build/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: "Build MSVC"
description: "Build memilio c++ library using MSVC on Windows"
description: "Build memilio c++ library using MSVC on Windows. Creates artifact build-windows-msvc-$version-$config."
inputs:
config:
description: "Configuration to build (Release or Debug, see CMAKE_BUILD_TYPE)"
Expand All @@ -10,7 +10,7 @@ inputs:
required: true
default: "latest"
optional-dependencies:
description: "Build the library with optional dependencies (ON or OFF)"
description: "Build the library with optional dependencies (ON or OFF). If OFF, adds `-nodep` to the artifact name"
required: false
default: "ON"
runs:
Expand Down Expand Up @@ -53,6 +53,7 @@ runs:
- name: Upload built binary files
uses: actions/upload-artifact@v3
with:
name: build-cpp-windows-msvc-${{ inputs.version }}-${{ inputs.config }}-${{ inputs.optional-dependencies == 'ON' && 'full' || 'part'}}
#artifacts in one pipeline must have a different name, so options must add a suffix to the artifact name if different values are used in the same pipeline
name: build-cpp-windows-msvc-${{ inputs.version }}-${{ inputs.config }}${{ inputs.optional-dependencies == 'OFF' && '-nodep' || ''}}
path: cpp/build-win/bin
retention-days: 1
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Please check our [git workflow](https://github.com/SciCompMod/memilio/wiki/git-w
- [ ] Every addressed issue is linked (use the "Closes #ISSUE" keyword below)
- [ ] New code adheres to [coding guidelines](https://github.com/SciCompMod/memilio/wiki/Coding-guidelines)
- [ ] No large data files have been added (files should in sum not exceed 100 KB, avoid PDFs, Word docs, etc.)
- [ ] Tests are added for new functionality and a local test run was successful
- [ ] Tests are added for new functionality and a local test run was successful (with and without OpenMP)
- [ ] Appropriate **documentation** for new functionality has been added (Doxygen in the code and Markdown files if necessary)
- [ ] Proper attention to licenses, especially no new third-party software with conflicting license has been added
- [ ] (For ABM development) Checked [benchmark results](https://github.com/SciCompMod/memilio/wiki/Agent-Based-Model-Development)
Expand Down
42 changes: 34 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@ jobs:
config: Release
optional-dependencies: OFF

build-cpp-gcc-openmp:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/linux-build
with:
compiler: gcc
version: latest
config: Release
openmp: ON

build-cpp-msvc:
if: github.event.pull_request.draft == false
strategy:
Expand Down Expand Up @@ -110,18 +122,32 @@ jobs:
- uses: actions/checkout@v3
- uses: ./.github/actions/linux-test
with:
build-artifact: build-cpp-linux-${{ matrix.compiler }}-${{ matrix.version }}-${{ matrix.config }}-full
build-artifact: build-cpp-linux-${{ matrix.compiler }}-${{ matrix.version }}-${{ matrix.config }}
coverage: ${{ (matrix.compiler == 'gcc' && matrix.version == 'latest' && matrix.config == 'Debug') && 'ON' || 'OFF' }}

test-linux-no-optional-deps:
test-cpp-gcc-no-optional-deps:
if: github.event.pull_request.draft == false
needs: build-cpp-gcc-no-optional-deps
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/linux-test
with:
build-artifact: build-cpp-linux-gcc-latest-Release-part
build-artifact: build-cpp-linux-gcc-latest-Release-nodep

test-cpp-gcc-openmp:
if: github.event.pull_request.draft == false
needs: build-cpp-gcc-openmp
runs-on: ubuntu-latest
timeout-minutes: 30
env:
OMP_NUM_THREADS: 4
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/linux-test
with:
build-artifact: build-cpp-linux-gcc-latest-Release-omp
num-repeat: 10

test-cpp-msvc:
if: github.event.pull_request.draft == false
Expand All @@ -140,17 +166,17 @@ jobs:
- uses: actions/checkout@v3
- uses: ./.github/actions/windows-test
with:
build-artifact: build-cpp-windows-msvc-${{ matrix.version }}-${{ matrix.config }}-full
build-artifact: build-cpp-windows-msvc-${{ matrix.version }}-${{ matrix.config }}

test-windows-no-optional-deps:
test-cpp-msvc-no-optional-deps:
if: github.event.pull_request.draft == false
needs: build-cpp-msvc-no-optional-deps
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/windows-test
with:
build-artifact: build-cpp-windows-msvc-latest-Release-part
build-artifact: build-cpp-windows-msvc-latest-Release-nodep

run_examples-cpp-gcc_clang:
if: github.event.pull_request.draft == false
Expand All @@ -170,7 +196,7 @@ jobs:
- uses: actions/checkout@v3
- uses: ./.github/actions/linux-run_examples
with:
build-artifact: build-cpp-linux-${{ matrix.compiler }}-${{ matrix.version }}-${{ matrix.config }}-full
build-artifact: build-cpp-linux-${{ matrix.compiler }}-${{ matrix.version }}-${{ matrix.config }}

run_examples-cpp-msvc:
if: github.event.pull_request.draft == false
Expand All @@ -189,7 +215,7 @@ jobs:
- uses: actions/checkout@v3
- uses: ./.github/actions/windows-run_examples
with:
build-artifact: build-cpp-windows-msvc-${{ matrix.version }}-${{ matrix.config }}-full
build-artifact: build-cpp-windows-msvc-${{ matrix.version }}-${{ matrix.config }}

build-py-generation:
if: github.event.pull_request.draft == false
Expand Down