From d0936d4dd353215b523f3c9885d3013f4a2ca8a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Juli=C3=A1n=20Espina?= Date: Thu, 10 Oct 2024 16:26:55 -0600 Subject: [PATCH] ci: add TiCS analysis --- .github/workflows/nightly-TICS.yaml | 45 +++++++++++++++++++++++++++++ .gitignore | 1 + tox.ini | 1 + 3 files changed, 47 insertions(+) create mode 100644 .github/workflows/nightly-TICS.yaml diff --git a/.github/workflows/nightly-TICS.yaml b/.github/workflows/nightly-TICS.yaml new file mode 100644 index 0000000..486e883 --- /dev/null +++ b/.github/workflows/nightly-TICS.yaml @@ -0,0 +1,45 @@ +name: Nightly TICS scan + +on: + schedule: + - cron: '03 05 * * *' # Every day at 05:03 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: | + python3 -m venv .venv + . .venv/bin/activate + pip install tox pylint flake8 + pip install --requirement requirements.txt + pip install --requirement dev-requirements.txt + echo PATH=$PATH >> $GITHUB_ENV + + - name: Run coverage tests + run: | + tox -e unit + + - name: TICS GitHub Action + uses: tiobe/tics-github-action@v3 + with: + mode: qserver + project: hpc-libs + viewerUrl: https://canonical.tiobe.com/tiobeweb/TICS/api/cfg?name=default + branchdir: ${{ env.GITHUB_WORKSPACE }} + ticsAuthToken: ${{ secrets.TICS_AUTH_TOKEN }} + installTics: true + calc: ALL diff --git a/.gitignore b/.gitignore index a26d707..6320e25 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ __pycache__/ *.py[cod] .idea .vscode/ +cover diff --git a/tox.ini b/tox.ini index 7dd5c44..0ee0a99 100644 --- a/tox.ini +++ b/tox.ini @@ -60,6 +60,7 @@ commands = {posargs} \ {[vars]tests_path}/unit coverage report + coverage xml -o cover/coverage.xml [testenv:static] description = Run static type checks