diff --git a/.github/workflows/build+test.yml b/.github/workflows/build+test.yml new file mode 100644 index 0000000..5111096 --- /dev/null +++ b/.github/workflows/build+test.yml @@ -0,0 +1,30 @@ +name: Build and test ccronexpr +on: + push: + branches: + - master + tags: + - test + - '[0-9]+.[0-9]+.[0-9]' + pull_request: + types: [opened, synchronize, labeled, reopened] + workflow_dispatch: + +concurrency: + group: "${{ github.workflow }}-${{ github.ref_type == 'tag' && ( (github.ref_name == '0.0.0-test' && 'test') || 'master') || github.ref_name }}" + cancel-in-progress: ${{ github.ref_type == 'tag' || github.ref_name != 'master' }} + +jobs: + build_test: + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4 + - name: Make build dir + run: mkdir -p "${{ github.workspace }}/build" + - name: Build with CMAKE + run: | + cmake -B "${{ github.workspace }}/build" -S ${{ github.workspace }} + cmake --build "${{ github.workspace }}/build" --target ccronexpr + - name: Run test executable + run: "${{ github.workspace }}/build/ccronexpr" diff --git a/.gitignore b/.gitignore index 95428ef..7e62b63 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,6 @@ /nbproject /Makefile /cmake-build-debug/ -/CMakeLists.txt /.idea/ a.out diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..b747b5f --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.28) +project(ccronexpr C) + +set(CMAKE_C_STANDARD 11) + +include_directories(.) + +add_executable(ccronexpr + ccronexpr.c + ccronexpr.h + ccronexpr_test.c)