Security and quality nightly scan #20
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: Security and quality nightly scan | |
on: | |
schedule: | |
# At 00:00 every day | |
- cron: '0 0 * * *' | |
permissions: | |
contents: read | |
jobs: | |
TICS: | |
permissions: | |
contents: read | |
runs-on: ubuntu-latest | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@v2 | |
with: | |
egress-policy: audit | |
- name: Checking out repo | |
uses: actions/checkout@v4 | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "1.22" | |
- name: go mod download | |
run: | | |
go mod download | |
- name: TICS scan | |
run: | | |
export TICSAUTHTOKEN=${{ secrets.TICSAUTHTOKEN }} | |
set -x | |
# TICS requires us to have the test results in cobertura xml format under the | |
# directory use below | |
sudo make test-unit | |
go install github.com/boumenot/gocover-cobertura@latest | |
gocover-cobertura < cover_all.out > coverage.xml | |
mkdir .coverage | |
mv ./coverage.xml ./.coverage/ | |
# Install the TICS and staticcheck | |
go install honnef.co/go/tools/cmd/staticcheck@v0.5.1 | |
. <(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/') | |
# We need to have our project built | |
# We load the dqlite libs here instead of doing through make because TICS | |
# will try to build parts of the project itself | |
go build -a ./... | |
TICSQServer -project ${{ github.event.repository.name }} -tmpdir /tmp/tics -branchdir $HOME/work/cluster-api-k8s/cluster-api-k8s/ |