Merge pull request #12 from Servostar/8-add-github-action-for-code-check
8 add GitHub action for code check (#12) reviewed by @flixm16 @SirTalksalot75
This commit is contained in:
commit
8bd4898440
|
@ -0,0 +1,14 @@
|
|||
name: "Build check gemstone in SDK"
|
||||
run-name: SDK build check to ${{ inputs.deploy_target }} by @${{ github.actor }}
|
||||
on: [push, pull_request]
|
||||
env:
|
||||
SDK: 0.1.0-alma-9.3
|
||||
jobs:
|
||||
build-check-sdk:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup SDK
|
||||
run: docker pull servostar/gemstone:sdk-"$SDK" && docker build --tag gemstone:devkit-"$SDK" .
|
||||
- name: Compile
|
||||
run: docker run gemstone:devkit-"$SDK" make check
|
|
@ -102,3 +102,28 @@ target_compile_options(debug PUBLIC ${FLAGS} -g)
|
|||
|
||||
# add src directory as include path
|
||||
target_include_directories(debug PUBLIC src)
|
||||
|
||||
# ------------------------------------------------ #
|
||||
# Target Code Check #
|
||||
# ------------------------------------------------ #
|
||||
|
||||
# Same as debug but will fail on warnings
|
||||
# use as check
|
||||
|
||||
add_executable(check
|
||||
${SOURCE_FILES}
|
||||
${LEX_GENERATED_SOURCE_FILE}
|
||||
${YACC_GENERATED_SOURCE_FILE})
|
||||
|
||||
set_target_properties(check
|
||||
PROPERTIES
|
||||
OUTPUT_NAME "gsc"
|
||||
RUNTIME_OUTPUT_DIRECTORY "bin/check")
|
||||
|
||||
# compiler flags targeting a GCC debug environment
|
||||
# extra -Werror flag to treat warnings as error to make github action fail on warning
|
||||
target_compile_options(check PUBLIC ${FLAGS} -g -Werror)
|
||||
|
||||
# add src directory as include path
|
||||
target_include_directories(check PUBLIC src)
|
||||
|
||||
|
|
|
@ -6,6 +6,11 @@
|
|||
int yylex();
|
||||
%}
|
||||
|
||||
/* disable the following functions */
|
||||
/* to avoid failing code check */
|
||||
%option nounput
|
||||
%option noinput
|
||||
|
||||
%%
|
||||
.;
|
||||
%%
|
Loading…
Reference in New Issue