Skip to content

Commit

Permalink
add Github Acctions to automatically build on push
Browse files Browse the repository at this point in the history
  • Loading branch information
kamarya committed Jun 29, 2024
1 parent 97bf494 commit ab1d772
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
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: |
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"

0 comments on commit ab1d772

Please sign in to comment.