1
- name : Security and quality nightly scan
1
+ name : TICS Analysis
2
2
3
3
on :
4
+ workflow_dispatch :
4
5
schedule :
5
- # At 00:00 every day
6
- - cron : ' 0 0 * * *'
6
+ - cron : ' 0 0 * * 0' # runs every sunday at 00:00
7
7
pull_request :
8
8
paths :
9
- - .github/workflows/cron-jobs .yaml
9
+ - .github/workflows/tics .yaml
10
10
11
11
permissions :
12
12
contents : read
13
13
14
+ concurrency :
15
+ group : ${{ github.workflow }}-${{ github.ref }}
16
+ cancel-in-progress : true
17
+
14
18
jobs :
15
19
TICS :
16
20
permissions :
17
21
contents : read
18
- runs-on : ubuntu-latest
22
+ runs-on : [self-hosted, linux, amd64, tiobe, jammy]
19
23
20
24
steps :
21
25
- name : Checking out repo
@@ -24,33 +28,37 @@ jobs:
24
28
- name : Install Go
25
29
uses : actions/setup-go@v5
26
30
with :
27
- go-version : " 1.23 "
31
+ go-version-file : go.mod
28
32
29
33
- name : go mod download
30
34
run : |
31
35
go mod download
32
36
33
- - name : TICS scan
37
+ - name : Prepare Go coverage and build
34
38
run : |
35
- export TICSAUTHTOKEN=${{ secrets.TICSAUTHTOKEN }}
36
-
37
- set -x
39
+ set -ex
38
40
39
41
# TICS requires us to have the test results in cobertura xml format under the
40
42
# directory use below
41
- sudo make test-unit
43
+ sudo env "PATH=$PATH" make test-unit
42
44
go install github.com/boumenot/gocover-cobertura@latest
43
45
gocover-cobertura < cover_all.out > coverage.xml
44
46
mkdir .coverage
45
47
mv ./coverage.xml ./.coverage/
46
48
47
- # Install the TICS and staticcheck
49
+ # Install staticcheck
48
50
go install honnef.co/go/tools/cmd/[email protected]
49
- . <(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/')
50
51
51
52
# We need to have our project built
52
53
# We load the dqlite libs here instead of doing through make because TICS
53
54
# will try to build parts of the project itself
54
55
go build -a ./...
55
-
56
- TICSQServer -project ${{ github.event.repository.name }} -tmpdir /tmp/tics -branchdir $HOME/work/cluster-api-k8s/cluster-api-k8s/
56
+
57
+ - name : Run TICS
58
+ uses : tiobe/tics-github-action@v3
59
+ with :
60
+ mode : qserver
61
+ project : ${{ github.event.repository.name }}
62
+ viewerUrl : https://canonical.tiobe.com/tiobeweb/TICS/api/cfg?name=GoProjects
63
+ ticsAuthToken : ${{ secrets.TICSAUTHTOKEN }}
64
+ installTics : true
0 commit comments