Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update(dummy_c): create a custom CI workflow for dummy_c #382

Merged
merged 4 commits into from
Dec 11, 2023
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
16 changes: 16 additions & 0 deletions .clang-format
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file will be used also by the k8smeta plugin

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
Language: Cpp
BasedOnStyle: LLVM
AccessModifierOffset: -8
BreakBeforeBraces: Allman
BreakConstructorInitializers: AfterColon
ColumnLimit: 80
ConstructorInitializerIndentWidth: 8
ContinuationIndentWidth: 8
DerivePointerAlignment: true
IndentWidth: 4
SortIncludes: Never
SpaceAfterTemplateKeyword: false
SpaceBeforeCtorInitializerColon: false
SpaceBeforeParens: Never
UseTab: Never
6 changes: 2 additions & 4 deletions .github/workflows/codeql-analysis.yml
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we cannot rely on the codeQL autobuild mode for complex cpp projects, dummy_c was a sort of exception because it is straightforward and doesn't have dependencies, but in order to follow a clear approach, we will have a general codeQL job for golang plugins and a dedicated codeQL job for each cpp plugin

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
name: "Golang CodeQL"

on:
push:
Expand Down Expand Up @@ -37,8 +37,6 @@ jobs:

strategy:
fail-fast: false
matrix:
language: [ 'cpp', 'go' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
Expand All @@ -55,7 +53,7 @@ jobs:
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
languages: go
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/dummy_c-ci.yaml
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dedicated CI for the dummy_c plugin

Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build dummy_c plugin
on:
pull_request:
branches: [ master ]
paths:
- 'plugins/dummy_c/**'
push:
branches: [ master ]
paths:
- 'plugins/dummy_c/**'
workflow_dispatch:

# Checks if any concurrent jobs under the same pull request or branch are being executed
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
build:
name: build
runs-on: ubuntu-22.04
steps:
- name: Checkout ⤵️
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

- name: Install deps ⛓️
run: |
sudo apt update -y
sudo apt install -y --no-install-recommends build-essential

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: cpp

- name: Build dummy_c plugin 🏗️
run: |
cd plugins/dummy_c
make libdummy_c.so

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

formatting-check:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Run clang-format style check
uses: jidicula/clang-format-action@f62da5e3d3a2d88ff364771d9d938773a618ab5e #v4.11.0
with:
clang-format-version: '14'
check-path: plugins/dummy_c
Loading
Loading