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: