Repository navigation
95 lines (82 loc) · 3.14 KB
/
Copy pathtics.yaml
File metadata and controls
95 lines (82 loc) · 3.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# Copyright 2026 Canonical Ltd.
# See LICENSE file for licensing details.
name: TICS
on:
schedule:
- cron: "0 4 * * 2"
workflow_dispatch:
permissions:
contents: read
jobs:
tics:
name: TICS
if: github.ref == 'refs/heads/main'
runs-on: self-hosted-linux-amd64-noble-tiobe
services:
postgres:
image: postgres:16.15
env:
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
- uses: actions/setup-python@v7
with:
python-version: "3.15"
- uses: actions/setup-dotnet@v6
env:
# Self-hosted runner user cannot write the default /usr/share/dotnet
DOTNET_INSTALL_DIR: ${{ runner.temp }}/dotnet
with:
dotnet-version: "10.0.x"
- name: Install linters and Python dependencies
run: |
go install honnef.co/go/tools/cmd/staticcheck@latest
pip install tox flake8 pylint
# Test dependencies too, so pylint can resolve imports in the analysed test files.
for c in garm garm-configurator planner-operator webhook-gateway-operator; do
pip install -r charms/$c/requirements.txt -r charms/$c/test-requirements.txt
done
pip install -r charms/tests/integration/requirements.txt
# Optional import in the vendored data_platform_libs charm library
pip install "psycopg[binary]"
- name: Go tests with coverage
env:
POSTGRESQL_DB_CONNECT_STRING: postgres://postgres:postgres@localhost:5432/postgres
run: |
mkdir -p /tmp/cov
go test -count=1 -tags=integration -coverprofile=/tmp/cov/go.out ./internal/... ./cmd/waiting-p80-report/...
go install github.com/boumenot/gocover-cobertura@latest
"$(go env GOPATH)/bin/gocover-cobertura" < /tmp/cov/go.out > /tmp/cov/go.xml
- name: Charm unit tests with coverage
run: |
mkdir -p /tmp/cov
for c in garm garm-configurator planner-operator webhook-gateway-operator; do
(cd charms/$c && tox -c tox.toml -e unit && .tox/unit/bin/coverage xml -o /tmp/cov/$c.xml && rm -rf .tox .coverage)
done
- name: Merge coverage
run: |
dotnet tool update --global dotnet-reportgenerator-globaltool
rm -rf .coverage
~/.dotnet/tools/reportgenerator -reports:"/tmp/cov/*.xml" -targetdir:.coverage -reporttypes:Cobertura
mv .coverage/Cobertura.xml .coverage/cobertura.xml
- name: TICS GitHub Action
uses: tiobe/tics-github-action@v4
with:
mode: qserver
project: github-runner-operators
branchdir: ${{ github.workspace }}
viewerUrl: https://canonical.tiobe.com/tiobeweb/TICS/api/cfg?name=GoProjects
ticsAuthToken: ${{ secrets.TICSAUTHTOKEN }}
installTics: true
concurrency:
group: tics
cancel-in-progress: false