actions: Adds missing dependencies for TICS job #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: TICS nightly quality scan | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 10 * * *' | |
pull_request: | |
permissions: | |
contents: read | |
jobs: | |
TICS: | |
permissions: | |
contents: read | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
# Latest branches | |
- { branch: main } | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@v2 | |
with: | |
egress-policy: audit | |
- name: Checking out repo | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{matrix.branch}} | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Install Go for Cobertura Coverage Converter | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "1.22" | |
- name: Run Tests With Coverage | |
run: | | |
set -eux -o pipefail | |
# tox required for running the unit tests with coverage: | |
# pylint and flake8 are required by TICSQServer | |
pip install tox pylint flake8 | |
tox -e unit,coverage-xml | |
# TiCS expects the report to be under a "$(pwd)/cover" directory. | |
mkdir -p "$GITHUB_WORKSPACE/cover" | |
GENERATED_COVERAGE_XML="$GITHUB_WORKSPACE/charms/worker/k8s/coverage.xml" | |
mv "$GENERATED_COVERAGE_XML" cover/coverage.xml | |
- name: Run TICS | |
run: | | |
export TICSAUTHTOKEN=${{ secrets.TICSAUTHTOKEN }} | |
# NOTE(aznashwan): TiCS install script doesn't define defaults; cannot '-u' | |
set -ex -o pipefail | |
# Install the TiCS and staticcheck | |
go install honnef.co/go/tools/cmd/[email protected] | |
. <(curl --silent --show-error 'https://canonical.tiobe.com/tiobeweb/TICS/api/public/v1/fapi/installtics/Script?cfg=default&platform=linux&url=https://canonical.tiobe.com/tiobeweb/TICS/') | |
TICSQServer -project k8s-operator -tmpdir /tmp/tics -branchdir "$GITHUB_WORKSPACE" |