Skip to content

Commit d8ae8e4

Browse files
authored
feat: dpe-6306 Static code analysis (#617)
* add TICS * address pr comments * capitalization fix
1 parent b0eaadc commit d8ae8e4

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

.github/actionlint.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
self-hosted-runner:
2+
labels:
3+
- self-hosted
4+
- tiobe

.github/workflows/tiobe_scan.yaml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Copyright 2025 Canonical Ltd.
2+
# See LICENSE file for licensing details.
3+
4+
# Usage documentation: static-code-analysis.md
5+
6+
name: TICS run self-hosted test (github-action)
7+
8+
on:
9+
schedule:
10+
- cron: "0 2 * * 6" # Every Saturday 2:00 AM UTC
11+
workflow_dispatch:
12+
13+
14+
jobs:
15+
tiobe-scan:
16+
name: Tiobe scan
17+
runs-on: [self-hosted, tiobe]
18+
timeout-minutes: 60
19+
steps:
20+
- name: Checkout the project
21+
uses: actions/checkout@v4
22+
23+
- name: Install system dependencies
24+
run: sudo apt-get update && sudo apt-get install -y python3-venv
25+
26+
- name: Install pipx
27+
run: python3 -m pip install --user pipx && python3 -m pipx ensurepath
28+
29+
- name: Add pipx to PATH
30+
run: echo "${HOME}/.local/bin" >> "${GITHUB_PATH}"
31+
32+
- name: Install tox and poetry using pipx
33+
run: |
34+
pipx install tox
35+
pipx install poetry
36+
37+
- name: Run tox tests to create coverage.xml
38+
run: tox run -e unit
39+
40+
- name: Move results to necessary folder for TICS
41+
run: |
42+
mkdir -p .cover
43+
mv coverage.xml .cover/cobertura.xml
44+
45+
- name: Run TICS analysis with github-action
46+
uses: tiobe/tics-github-action@v3
47+
with:
48+
mode: qserver
49+
project: mysql-operator
50+
branchdir: .
51+
viewerUrl: https://canonical.tiobe.com/tiobeweb/TICS/api/cfg?name=default
52+
ticsAuthToken: ${{ secrets.TICSAUTHTOKEN }}
53+
installTics: true

0 commit comments

Comments
 (0)