This repository was archived by the owner on Apr 12, 2026. It is now read-only.
Repository navigation
107 lines (96 loc) · 3.51 KB
/
Copy pathcode_analysis.yml
File metadata and controls
107 lines (96 loc) · 3.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Code Analysis
on:
push:
branches:
- main
pull_request:
branches:
- main
types:
- opened
- synchronize
- reopened
env:
AFPFS_NG_VERSION: "0.9.4"
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory
jobs:
clang-format:
name: Code Formatting Check
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install clang-format-20
run: |
curl --proto '=https' --tlsv1.2 -fsSL https://apt.llvm.org/llvm-snapshot.gpg.key \
| sudo gpg --dearmor -o /etc/apt/keyrings/llvm.gpg
echo "deb [signed-by=/etc/apt/keyrings/llvm.gpg] https://apt.llvm.org/noble/ llvm-toolchain-noble-20 main" \
| sudo tee /etc/apt/sources.list.d/llvm.list
sudo apt-get update
sudo apt-get install --assume-yes --no-install-recommends clang-format-20
- name: Check formatting
run: git ls-files '*.cpp' '*.h' | xargs clang-format-20 --dry-run --Werror
static_analysis:
name: SonarQube Static Analysis
runs-on: ubuntu-latest
permissions:
contents: read
if: >
(github.event_name == 'push' && github.actor != 'dependabot[bot]' && github.actor != 'dependabot') || (github.event_name
== 'pull_request' && !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' && github.actor
!= 'dependabot')
container:
image: debian:13.3
steps:
- name: Install dependencies
run: |
apt-get update
apt-get install --assume-yes --no-install-recommends \
build-essential \
ca-certificates \
cmake \
curl \
extra-cmake-modules \
g++ \
gettext \
git \
libfuse3-dev \
libgcrypt20-dev \
libkf6i18n-dev \
libkf6kio-dev \
libkf6service-dev \
libreadline-dev \
meson \
ninja-build \
pkg-config \
qt6-base-dev \
unzip \
xz-utils
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Build and install afpfs-ng
run: |
curl --proto '=https' --tlsv1.2 -fLO https://github.com/Netatalk/afpfs-ng/releases/download/${{ env.AFPFS_NG_VERSION }}/afpfs-ng-${{ env.AFPFS_NG_VERSION }}.tar.xz
tar xf afpfs-ng-${{ env.AFPFS_NG_VERSION }}.tar.xz
cd afpfs-ng-${{ env.AFPFS_NG_VERSION }}
meson setup build --prefix=/usr
meson compile -C build
meson install -C build
- name: Install Build Wrapper
uses: SonarSource/sonarqube-scan-action/install-build-wrapper@a31c9398be7ace6bbfaf30c0bd5d415f843d45e9 # v7.0.0
- name: Run Build Wrapper
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Debug
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build build
- name: Run SonarQube scan
uses: SonarSource/sonarqube-scan-action@a31c9398be7ace6bbfaf30c0bd5d415f843d45e9 # v7.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
--define sonar.projectKey=Netatalk_kio-afp
--define sonar.organization=netatalk
--define sonar.cfamily.compile-commands=${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json