refactor: add minor elements to the repo - round (2) (#58) #899
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Catch2 | |
on: [push] | |
jobs: | |
platform-compatibility: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [macos-12, ubuntu-22.04] | |
fail-fast: false | |
env: | |
working-directory: .test/unit | |
steps: | |
- name: Install MPFR | |
run: | | |
if [ "$RUNNER_OS" == "Linux" ]; then | |
sudo apt-get update -y | |
sudo apt-get install -y libmpfr-dev | |
elif [ "$RUNNER_OS" == "macOS" ]; then | |
brew update | |
brew install mpfr | |
fi | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Copy Library Directory | |
working-directory: ${{env.working-directory}} | |
run: cp -r ../../hypercomplex hypercomplex | |
- name: Display compiler version | |
run: g++ --version | |
- name: Compile Test Program | |
working-directory: ${{env.working-directory}} | |
run: g++ -O0 -Wall --std=c++17 -o test test.cpp -lmpfr -lgmp | |
- name: Execute Test Program | |
working-directory: ${{env.working-directory}} | |
run: ./test [unit] -d yes -w NoAssertions --use-colour yes --benchmark-samples 100 --benchmark-resamples 100000 | |
code-coverage: | |
runs-on: ubuntu-22.04 | |
env: | |
working-directory: .test/unit | |
steps: | |
- name: Install lcov | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install -y lcov | |
- name: Install MPFR | |
run: sudo apt-get install -y libmpfr-dev | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Copy Library Directory | |
working-directory: ${{env.working-directory}} | |
run: cp -r ../../hypercomplex hypercomplex | |
- name: Display compiler version | |
run: clang++ --version | |
- name: Compile Test Program | |
working-directory: ${{env.working-directory}} | |
run: g++ -O0 -fprofile-arcs -ftest-coverage -fno-elide-constructors -Wall --std=c++17 --coverage -o test test.cpp -lmpfr -lgmp | |
- name: Execute Test Program | |
working-directory: ${{env.working-directory}} | |
run: ./test [unit] | |
- name: Generate Coverage Report | |
working-directory: ${{env.working-directory}} | |
run: | | |
gcov test.cpp | |
lcov --capture --directory . --output-file coverage.info | |
rm -rf *.gcov test.gc* | |
- name: Submit Report to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: .test/unit/coverage.info | |
fail_ci_if_error: true | |
verbose: true | |
memcheck: | |
runs-on: ubuntu-22.04 | |
env: | |
working-directory: .test/unit | |
steps: | |
- name: Install MPFR | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install -y libmpfr-dev | |
- name: Install Valgrind | |
run: sudo apt install -y valgrind | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Copy Library Directory | |
working-directory: ${{env.working-directory}} | |
run: cp -r ../../hypercomplex hypercomplex | |
- name: Display compiler version | |
run: g++ --version | |
- name: Compile Test Program | |
working-directory: ${{env.working-directory}} | |
run: g++ -O0 -Wall --std=c++17 -o test test.cpp -lmpfr -lgmp | |
- name: Analyze Test Program Execution | |
working-directory: ${{env.working-directory}} | |
run: | | |
valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose --log-file=valgrind.txt ./test [unit] | |
cat valgrind.txt | |
grep -q -w "All heap blocks were freed -- no leaks are possible" "valgrind.txt" |