From c5ca70c4ec8ef2219ffd6e1b6a04c96b55bb49c4 Mon Sep 17 00:00:00 2001 From: Kamary <6436370+kamarya@users.noreply.github.com> Date: Fri, 28 Jun 2024 23:52:31 -0700 Subject: [PATCH] add Github Actions to automatically build on every push --- .github/workflows/github-actions.yml | 55 ++++++++++++++++++++++++++++ README.md | 4 +- 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/github-actions.yml diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml new file mode 100644 index 0000000..46bd1a5 --- /dev/null +++ b/.github/workflows/github-actions.yml @@ -0,0 +1,55 @@ +name: Build and Test + +on: [push] + +jobs: + build-and-test: + runs-on: ubuntu-latest + strategy: + matrix: + compiler: [gcc, clang] + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Cache directories + uses: actions/cache@v2 + with: + path: ~/.cache + key: ${{ runner.os }}-cache + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install lcov + + - name: Create build directory + run: mkdir build + + - name: Configure CMake + run: | + cd build + cmake .. -DCODE_COVERAGE=ON -DEXAMPLES=OFF + + - name: Build and test + run: | + cd build + make + make test + + - name: Collect code coverage + run: | + lcov --directory . --capture --output-file coverage.info + lcov --remove coverage.info '/usr/*' "${HOME}"'/.cache/*' --output-file coverage.info + lcov --list coverage.info + + - name: Upload code coverage to Codecov + run: | + bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports" + + - name: Upload code coverage to GitHub + uses: actions/upload-artifact@v2 + with: + name: coverage + path: coverage.info \ No newline at end of file diff --git a/README.md b/README.md index 91a3428..21e02f9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ -# Susa Open Source Project [![codecov][codecov-badge]][codecov-link] +# Susa Open Source Project + +![example workflow](https://github.com/libsusa/susa/actions/workflows/github-actions.yml/badge.svg) [![codecov][codecov-badge]][codecov-link] Susa is a mathematics and signal processing C++ [framework](https://en.wikipedia.org/wiki/Software_framework) based on [KISS](https://en.wikipedia.org/wiki/KISS_principle) principle. It is stand-alone with a modern architecture. It is designed not to have any dependencies to none standard third