Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/cpp-standard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: PCDS CPP Standard Tests

on:
workflow_call:
inputs:
project-root:
required: false
type: string
default: "."
description: "The root directory of the CPP project"

jobs:
pre-commit:
name: "pre-commit checks"
uses: ./.github/workflows/pre-commit.yml
secrets: inherit
with:
args: "--all-files"
system-packages: "cppcheck"
12 changes: 12 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ on:
description: "Use the problem matcher to annotate the PR diff"
required: false
type: boolean
system-packages:
default: ""
description: "Space-separated list of system packages to install before running pre-commit"
required: false
type: string

jobs:
pre-commit:
Expand All @@ -25,6 +30,7 @@ jobs:
- uses: actions/checkout@v4
with:
token: ${{ secrets.CHECKOUT_TOKEN || github.token }}

- name: Configure the matcher to annotate the diff
if: ${{ inputs.annotate }}
run: |
Expand Down Expand Up @@ -65,6 +71,12 @@ jobs:
EOF
echo "::add-matcher::$HOME/flake8_problem_matcher.json"

- name: Install required system packages
if: inputs.system-packages != ''
run: |
sudo apt-get update
sudo apt-get -y install ${{ inputs.system-packages }}

- name: Install pre-commit
run: |
python -m pip install pre-commit
Expand Down
Loading