|
| 1 | +name: TIOBE TiCS Framework - Report |
| 2 | + |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + - cron: "0 0 * * 1" # Runs every Monday at midnight |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | +concurrency: |
| 9 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 10 | + cancel-in-progress: true |
| 11 | + |
| 12 | +env: |
| 13 | + apt_dependencies: >- |
| 14 | + ca-certificates curl dconf-cli gcc gettext git libnss-wrapper libsmbclient-dev |
| 15 | + libkrb5-dev libwbclient-dev pkg-config python3-coverage pylint samba sudo |
| 16 | + libglib2.0-dev gvfs libpam0g-dev |
| 17 | +
|
| 18 | +jobs: |
| 19 | + tics: |
| 20 | + name: TIOBE TiCS Framework |
| 21 | + runs-on: ${{ vars.RUNNER }} |
| 22 | + steps: |
| 23 | + - uses: actions/checkout@v7 |
| 24 | + - uses: actions/setup-go@v7 |
| 25 | + with: |
| 26 | + go-version-file: go.mod |
| 27 | + - uses: canonical/desktop-engineering/gh-actions/common/dpkg-install-speedup@main |
| 28 | + - name: Install dependencies |
| 29 | + run: | |
| 30 | + sudo apt-get update |
| 31 | + sudo DEBIAN_FRONTEND=noninteractive apt-get install -y ${{ env.apt_dependencies }} |
| 32 | + go install honnef.co/go/tools/cmd/staticcheck@latest |
| 33 | + dotnet tool install -g dotnet-reportgenerator-globaltool |
| 34 | +
|
| 35 | + - name: Merge coverage reports |
| 36 | + env: |
| 37 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 38 | + run: | |
| 39 | + set -e |
| 40 | +
|
| 41 | + # Download, combine and move coverage to the right place so TiCS can parse it. |
| 42 | + # The Go coverage from the QA workflow is always expected to be available. |
| 43 | + RUN_ID=$(gh run list --workflow 'QA & sanity checks' --limit 1 --status success --json databaseId -b main --jq '.[].databaseId') |
| 44 | + if [ -z "$RUN_ID" ]; then |
| 45 | + echo "::error::No successful 'QA & sanity checks' run found on main" |
| 46 | + exit 1 |
| 47 | + fi |
| 48 | + gh run download "$RUN_ID" -n coverage.zip -D /tmp/coverage |
| 49 | +
|
| 50 | + # PAM coverage comes from the E2E workflow, which may not always have a recent |
| 51 | + # successful run. Treat it as best-effort so the scan still runs without it. |
| 52 | + E2E_RUN_ID=$(gh run list --workflow 'E2E - Run tests' --limit 1 --status success --json databaseId -b main --jq '.[].databaseId') |
| 53 | + if [ -n "$E2E_RUN_ID" ]; then |
| 54 | + gh run download "$E2E_RUN_ID" -n pam-coverage.zip -D /tmp/coverage || echo "::warning::pam-coverage.zip not found in run $E2E_RUN_ID; skipping PAM coverage" |
| 55 | + else |
| 56 | + echo "::warning::No successful 'E2E - Run tests' run found on main; skipping PAM coverage" |
| 57 | + fi |
| 58 | +
|
| 59 | + reportgenerator "-reports:/tmp/coverage/*.xml" "-targetdir:.coverage" -reporttypes:Cobertura |
| 60 | + mv .coverage/Cobertura.xml .coverage/coverage.xml |
| 61 | +
|
| 62 | + - name: Set up temporary directory for TiCS |
| 63 | + run: | |
| 64 | + mkdir -p /tmp/tics-${{ github.run_id }}-${{ github.run_attempt }} |
| 65 | +
|
| 66 | + - name: TICS Analysis |
| 67 | + env: |
| 68 | + TMPDIR: /tmp/tics-${{ github.run_id }}-${{ github.run_attempt }} |
| 69 | + uses: tiobe/tics-github-action@v3 |
| 70 | + with: |
| 71 | + mode: qserver |
| 72 | + project: adsys |
| 73 | + branchdir: . |
| 74 | + viewerUrl: https://canonical.tiobe.com/tiobeweb/TICS/api/cfg?name=GoProjects |
| 75 | + ticsAuthToken: ${{ secrets.TICSAUTHTOKEN }} |
| 76 | + installTics: true |
| 77 | + # Persist TiCS debug information (including the run log) to a known |
| 78 | + # location. Setting this input makes the action upload that directory |
| 79 | + # as an artifact, so failing analyses can be inspected. |
| 80 | + tmpdir: /tmp/tics-${{ github.run_id }}-${{ github.run_attempt }} |
0 commit comments