From 009a093326cb3746853b029d9faad03edf330d30 Mon Sep 17 00:00:00 2001 From: Lucas Petrino Date: Wed, 4 Jun 2025 13:04:13 +1200 Subject: [PATCH] Initial Commit --- Dockerfile | 14 ++++++++++++++ action.yml | 17 +++++++++++++++++ runchecks.sh | 3 +++ 3 files changed, 34 insertions(+) create mode 100644 Dockerfile create mode 100644 action.yml create mode 100644 runchecks.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4fd10a5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM ubuntu:24.04 + +WORKDIR /build +RUN apt update -y +RUN apt install -y cmake curl wget cppcheck + +RUN wget https://apt.llvm.org/llvm.sh && \ + chmod +x llvm.sh && \ + ./llvm.sh 20 + +ADD runchecks.sh /entrypoint.sh +COPY . . +RUN chmod +x /entrypoint.sh +ENTRYPOINT /entrypoint.sh \ No newline at end of file diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..314d34f --- /dev/null +++ b/action.yml @@ -0,0 +1,17 @@ +name: CPPCheck +author: CSSUDII +inputs: + path: + description: 'Project Directory' + required: false + default: '.' + opts: + description: 'Additional cppcheck flags' + required: false + default: '--enable=warning' +runs: + using: 'docker' + image: 'Dockerfile' + args: + - ${{ inputs.path }} + - ${{ inputs.opts }} \ No newline at end of file diff --git a/runchecks.sh b/runchecks.sh new file mode 100644 index 0000000..2168aca --- /dev/null +++ b/runchecks.sh @@ -0,0 +1,3 @@ +#! /bin/bash + +cppcheck "$2" --language=c++ --template="::{severity} file={file},line={line},col={column}::{message} | prbot" "$1" \ No newline at end of file