Skip to content

Commit 25065dd

Browse files
authored
fix: separate tics and use new action (#157)
Signed-off-by: Reza Abbasalipour <[email protected]>
1 parent dad1d76 commit 25065dd

File tree

1 file changed

+23
-15
lines changed

1 file changed

+23
-15
lines changed
Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
1-
name: Security and quality nightly scan
1+
name: TICS Analysis
22

33
on:
4+
workflow_dispatch:
45
schedule:
5-
# At 00:00 every day
6-
- cron: '0 0 * * *'
6+
- cron: '0 0 * * 0' # runs every sunday at 00:00
77
pull_request:
88
paths:
9-
- .github/workflows/cron-jobs.yaml
9+
- .github/workflows/tics.yaml
1010

1111
permissions:
1212
contents: read
1313

14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
1418
jobs:
1519
TICS:
1620
permissions:
1721
contents: read
18-
runs-on: ubuntu-latest
22+
runs-on: [self-hosted, linux, amd64, tiobe, jammy]
1923

2024
steps:
2125
- name: Checking out repo
@@ -24,33 +28,37 @@ jobs:
2428
- name: Install Go
2529
uses: actions/setup-go@v5
2630
with:
27-
go-version: "1.23"
31+
go-version-file: go.mod
2832

2933
- name: go mod download
3034
run: |
3135
go mod download
3236
33-
- name: TICS scan
37+
- name: Prepare Go coverage and build
3438
run: |
35-
export TICSAUTHTOKEN=${{ secrets.TICSAUTHTOKEN }}
36-
37-
set -x
39+
set -ex
3840
3941
# TICS requires us to have the test results in cobertura xml format under the
4042
# directory use below
41-
sudo make test-unit
43+
sudo env "PATH=$PATH" make test-unit
4244
go install github.com/boumenot/gocover-cobertura@latest
4345
gocover-cobertura < cover_all.out > coverage.xml
4446
mkdir .coverage
4547
mv ./coverage.xml ./.coverage/
4648
47-
# Install the TICS and staticcheck
49+
# Install staticcheck
4850
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/')
5051
5152
# We need to have our project built
5253
# We load the dqlite libs here instead of doing through make because TICS
5354
# will try to build parts of the project itself
5455
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

Comments
 (0)