Skip to content

Commit

Permalink
feat: introduce TiCS analysis to the repo
Browse files Browse the repository at this point in the history
  • Loading branch information
jedel1043 authored and NucciTheBoss committed Oct 2, 2024
1 parent ebc7f2f commit 8dd8809
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
36 changes: 36 additions & 0 deletions .github/workflows/nightly-TICS.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Nightly TICS scan

on:
schedule:
- cron: '15 17 * * *' # Every day at 17:15 UTC
workflow_dispatch:

permissions:
contents: read

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

- name: Install dependencies
run: |
python3 -m pip install tox pylint flake8
python3 -m pip install --requirement test-requirements.txt
- name: Run coverage tests
run: |
tox -e unit
- name: TICS GitHub Action
uses: tiobe/tics-github-action@v3
with:
mode: qserver
project: slurm-charms
viewerUrl: https://canonical.tiobe.com/tiobeweb/TICS/api/cfg?name=default
branchdir: ${{ env.GITHUB_WORKSPACE }}
ticsAuthToken: ${{ secrets.TICS_AUTH_TOKEN }}
installTics: true
calc: ALL
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ version
.ruff_cache/
_build
.charmhub.secret
cover
3 changes: 2 additions & 1 deletion repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,8 @@ def unit_test_cli(
logger.info("Generating global results...")
subprocess.run(["coverage", "combine"] + files, check=True)
subprocess.run(["coverage", "report"], check=True)
logger.info(f"File generated at {ROOT_DIR}/.coverage")
subprocess.run(["coverage", "xml", "-o", "cover/coverage.xml"])
logger.info(f"XML report generated at {ROOT_DIR}/cover/coverage.xml")


def build_cli(
Expand Down

0 comments on commit 8dd8809

Please sign in to comment.