Skip to content

Commit

Permalink
Merge pull request #2 from lobaro/feature/test-workflow
Browse files Browse the repository at this point in the history
Add test workflow for github actions
  • Loading branch information
Kniggebrot authored Oct 21, 2024
2 parents 3082af6 + 0f347ce commit ffb1840
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
30 changes: 30 additions & 0 deletions .github/workflows/build+test.yml
Original file line number Diff line number Diff line change
@@ -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"
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/nbproject
/Makefile
/cmake-build-debug/
/CMakeLists.txt
/.idea/
a.out

11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit ffb1840

Please sign in to comment.