Skip to content

Commit e060a91

Browse files
[DPE-6218] Static code analysis (#915)
* Create actionlint.yaml * Create tiobe_scan.yaml * Add push event to trigger the workflow once * Install libpq-dev * Remove push event * Test adding unit venv to PATH * Test sourcing unit venv * Fix sourcing * Test installing dependencies * Activate virtual environment * Add poetry dependency * Fix TICS auth token variable * Move results to the right folder * Delete .github/actionlint.yaml * Install ops * Install dependencies through poetry * Install extra dependencies * Install dependencies from all groups * Remove unnecessary step * Remove permission * Remove push trigger * Add double quotes to environment variables Signed-off-by: Marcelo Henrique Neppel <[email protected]> * Add push trigger * Remove push trigger Signed-off-by: Marcelo Henrique Neppel <[email protected]> --------- Signed-off-by: Marcelo Henrique Neppel <[email protected]>
1 parent 3ce2aa5 commit e060a91

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/tiobe_scan.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Copyright 2025 Canonical Ltd.
2+
# See LICENSE file for licensing details.
3+
4+
name: Weekly TICS scan
5+
6+
on:
7+
schedule:
8+
- cron: "0 2 * * 6" # Every Saturday 2:00 AM UTC
9+
workflow_dispatch:
10+
11+
jobs:
12+
TICS:
13+
runs-on: ubuntu-24.04
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Create and activate virtual environment
19+
run: |
20+
python3 -m venv .venv
21+
. .venv/bin/activate
22+
pip install flake8 poetry pylint pytest tox
23+
poetry install --all-groups
24+
echo PATH="$PATH" >> "$GITHUB_ENV"
25+
26+
- name: Run coverage tests
27+
run: |
28+
tox -e unit
29+
30+
- name: Move results to the necessary folder for TICS
31+
run: |
32+
mkdir -p .cover
33+
mv coverage.xml .cover/cobertura.xml
34+
35+
- name: TICS GitHub Action
36+
uses: tiobe/tics-github-action@v3
37+
with:
38+
mode: qserver
39+
project: postgresql-k8s-operator
40+
viewerUrl: https://canonical.tiobe.com/tiobeweb/TICS/api/cfg?name=default
41+
branchdir: ${{ env.GITHUB_WORKSPACE }}
42+
ticsAuthToken: ${{ secrets.TICSAUTHTOKEN }}
43+
installTics: true
44+
calc: ALL

0 commit comments

Comments
 (0)