From 6479e8c98d7f6f03ecffcaa75055ce78292d94c8 Mon Sep 17 00:00:00 2001 From: Daniel Trugman Date: Sun, 21 Feb 2021 21:58:44 +0200 Subject: [PATCH] Add GitHub build & test action --- .github/workflows/cmake.yml | 31 +++++++++++++++++++++++++++++++ README.md | 2 ++ 2 files changed, 33 insertions(+) create mode 100644 .github/workflows/cmake.yml diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml new file mode 100644 index 0000000..de40c1a --- /dev/null +++ b/.github/workflows/cmake.yml @@ -0,0 +1,31 @@ +name: Build & Test + +on: [push] + +env: + BUILD_TYPE: Release + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Create Build Environment + run: cmake -E make_directory ${{github.workspace}}/build + + - name: Configure CMake + shell: bash + working-directory: ${{github.workspace}}/build + run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE + + - name: Build + working-directory: ${{github.workspace}}/build + shell: bash + run: cmake --build . --config $BUILD_TYPE + + - name: Test + working-directory: ${{github.workspace}}/build + shell: bash + run: ./out/unittest diff --git a/README.md b/README.md index 82e3d43..843545d 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ Very easy to use, procfs parsing library in C++. ## Build +![Build & Test](https://github.com/dtrugman/pfs/actions/workflows/cmake.yml/badge.svg) + Run `cmake . && make` Currently supported CMake configuration flags: