Skip to content

ci: add Tiobe TICS nightly workflow with coverage #1

ci: add Tiobe TICS nightly workflow with coverage

ci: add Tiobe TICS nightly workflow with coverage #1

name: Tiobe TICS nightly report
on:
schedule:
- cron: '0 10 * * *'
pull_request:
permissions:
contents: read
jobs:
TICS:
permissions:
contents: read
runs-on: ubuntu-latest
strategy:
matrix:
include:
# Latest branches
- { branch: master}
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}}
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
- name: go mod download
run: go mod download
- name: Run Tests with Coverage
run: |
set -eux -o pipefail
# TiCS requires us to have the test results in cobertura xml format under the
# directory used below
sudo make go.coverage
go install github.com/boumenot/gocover-cobertura@latest
gocover-cobertura < coverage.txt > .coverage/coverage.xml
cat ./.coverage/coverage.xml
- name: Build Project
run: |
set -eux -o pipefail
# We load the dqlite libs here instead of doing through make because TICS
# will try to build parts of the project itself
sudo add-apt-repository -y ppa:dqlite/dev
sudo apt install dqlite-tools libdqlite-dev -y
# We need to have our project built
sudo make clean
sudo make -j static
- name: Install and 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 ${{ github.event.repository.name }} -tmpdir /tmp/tics -branchdir "$GITHUB_WORKSPACE"