Skip to content

Commit

Permalink
ci: add a workflow that runs the TIOBE quality checks (canonical#1301)
Browse files Browse the repository at this point in the history
This workflow will run the TIOBE "TICS" quality checks and reports them
through to the TIOBE server.

It's set to run on the first of each month, so that we have regular
updates in TIOBE, but without this hitting every PR (the ruff checks we
have are doing that work).

There's a manual way to do this and there's their packaged action. The
action seems the cleaner choice, so I've gone with that. We still have
to provide the coverage file - we could store that from the normal run
and retrieve it here, which would save the resources of re-running the
tests, but it feels like it is cleaner to keep these completely
separate, which also works well with us splitting that out.
  • Loading branch information
tonyandrewmeyer authored Aug 20, 2024
1 parent 828b542 commit e3fb5a0
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/tiobe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: TIOBE Quality Checks

on:
schedule:
- cron: '0 7 1 * *'

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

# We could store the report from the regular run, but this is cheap to do and keeps this isolated.
- name: Set up Python
uses: actions/setup-python@v5
- name: Install dependencies
run: pip install tox~=4.2 coverage[toml] flake8 pylint websocket-client==1.* pyyaml==6.* pytest~=7.2 pytest-operator~=0.23
- name: Generate coverage report
run: |
tox -e unit
coverage xml
# Annoyingly, the coverage.xml file needs to be in a .coverage folder.
rm .coverage
mkdir .coverage
mv coverage.xml .coverage/
- name: TICS GitHub Action
uses: tiobe/tics-github-action@v3
with:
mode: qserver
viewerUrl: https://canonical.tiobe.com/tiobeweb/TICS/api/cfg?name=default
ticsAuthToken: ${{ secrets.TICSAUTHTOKEN }}
project: operator
installTics: true

0 comments on commit e3fb5a0

Please sign in to comment.