From 6b7d6b5830581db2d9db231061c5cc86f228d4e9 Mon Sep 17 00:00:00 2001 From: Tony Meyer Date: Wed, 28 Aug 2024 14:13:35 +1200 Subject: [PATCH] ci: add a monthly (or on demand) TIOBE reporting workflow (#494) Once a month, send the latest code quality (including coverage) data to TIOBE for central storage. --------- Co-authored-by: Ben Hoyt --- .github/workflows/tiobe.yaml | 39 ++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/tiobe.yaml diff --git a/.github/workflows/tiobe.yaml b/.github/workflows/tiobe.yaml new file mode 100644 index 00000000..1bc3d71c --- /dev/null +++ b/.github/workflows/tiobe.yaml @@ -0,0 +1,39 @@ +name: TIOBE Quality Checks + +on: + workflow_dispatch: + schedule: + - cron: '0 7 1 * *' + +jobs: + TICS: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + + - name: Install dependencies + run: | + go install honnef.co/go/tools/cmd/staticcheck@v0.5.1 + go install github.com/axw/gocov/gocov@v1.1.0 + go install github.com/AlekSi/gocov-xml@v1.1.0 + + # We could store a report from the regular run, but this is cheap to do and keeps this isolated. + - name: Test and generate coverage report + run: | + go test -coverprofile=coverage.out ./... + gocov convert coverage.out > coverage.json + # Annoyingly, the coverage.xml file needs to be in a .coverage folder. + mkdir .coverage + gocov-xml < coverage.json > .coverage/coverage.xml + + - 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: pebble + installTics: true