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

Static code analysis #915

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from
Draft
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
53 changes: 53 additions & 0 deletions .github/workflows/tiobe_scan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

name: Weekly TICS scan

on:
push:
schedule:
- cron: "0 2 * * 6" # Every Saturday 2:00 AM UTC
workflow_dispatch:

permissions:
contents: read

jobs:
TICS:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install requirements
run: |
sudo apt update -y
sudo apt install python3-venv -y

- name: Create and activate virtual environment
run: |

Check failure on line 28 in .github/workflows/tiobe_scan.yaml

View workflow job for this annotation

GitHub Actions / Lint / Lint .github/workflows/

shellcheck reported issue in this script: SC2086:info:5:11: Double quote to prevent globbing and word splitting

Check failure on line 28 in .github/workflows/tiobe_scan.yaml

View workflow job for this annotation

GitHub Actions / Lint / Lint .github/workflows/

shellcheck reported issue in this script: SC2086:info:5:20: Double quote to prevent globbing and word splitting
python3 -m venv .venv
. .venv/bin/activate
pip install flake8 juju poetry psycopg pylint pytest pytest_operator tox
poetry install
echo PATH=$PATH >> $GITHUB_ENV

- name: Run coverage tests
run: |
tox -e unit

- name: Move results to the necessary folder for TICS
run: |
mkdir -p .cover
mv coverage.xml .cover/cobertura.xml

- name: TICS GitHub Action
uses: tiobe/tics-github-action@v3
with:
mode: qserver
project: postgresql-k8s-operator
viewerUrl: https://canonical.tiobe.com/tiobeweb/TICS/api/cfg?name=default
branchdir: ${{ env.GITHUB_WORKSPACE }}
ticsAuthToken: ${{ secrets.TICSAUTHTOKEN }}
installTics: true
calc: ALL
Loading