-
Notifications
You must be signed in to change notification settings - Fork 0
131 lines (116 loc) · 3.48 KB
/
style.yml
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
---
name: "Style"
on: # yamllint disable-line rule:truthy
push:
branches: "**"
jobs:
setup:
runs-on: "self-hosted"
steps:
- uses: "actions/checkout@v4"
- uses: "actions/setup-python@v3"
with:
python-version: "3.10.12"
- name: "Install Python dependencies"
run: |
pip install --no-cache-dir --user \
pylint==3.2.4 mypy==1.10.1 flake8==7.1.0 yamllint==1.35.1
run-markdown-lint:
runs-on: "self-hosted"
needs: "setup"
steps:
- name: "Lint Markdown files"
uses: "articulate/actions-markdownlint@v1"
with:
version: "0.41.0"
run-yaml-lint:
runs-on: "self-hosted"
needs: "setup"
steps:
- name: "Lint YAML files"
run: "yamllint ."
run-shell-check:
runs-on: "self-hosted"
needs: "setup"
steps:
- name: "Lint shell scripts"
uses: "ludeeus/action-shellcheck@master"
with:
version: "v0.10.0"
run-docker-hadolint:
runs-on: "self-hosted"
needs: "setup"
steps:
- name: "Lint Dockerfiles"
uses: "hadolint/[email protected]"
with:
dockerfile: "Dockerfile"
recursive: true
run-terraform-tflint:
runs-on: "self-hosted"
needs: "setup"
steps:
- uses: "terraform-linters/setup-tflint@v4"
with:
tflint_version: "v0.51.1"
- name: "Lint Terraform testing infrastructure"
run: "tflint --init && tflint"
working-directory: "./tests/setup"
run-ansible-lint:
runs-on: "self-hosted"
needs: "setup"
steps:
- name: "Lint ansible testing playbook"
uses: "ansible/[email protected]"
run-python-pylint:
runs-on: "self-hosted"
needs: "setup"
steps:
- name: "Lint Python files with pylint"
run: "pylint $(find . -name '*.py')"
run-python-mypy:
runs-on: "self-hosted"
needs: "setup"
steps:
- name: "Lint Python files with mypy"
run: "mypy $(find . -name '*.py')"
run-python-flake8:
runs-on: "self-hosted"
needs: "setup"
steps:
- name: "Lint Python files with flake8"
run: "flake8"
run-system-tests-coverage:
runs-on: "self-hosted"
needs: "setup"
steps:
- name: "Calculate system tests coverage"
run: |
echo "COVERAGE=$((
100
-
$(grep --extended-regexp '^[^#]*[[:alnum:]]' ${{ env.TESTSUITE_RUN_FILE }} | wc --lines)
*
100
/
(
$(grep --extended-regexp '^[^#]*[[:alnum:]]' ${{ env.MAIN_RUN_FILE }} ${{ env.COMMON_RUN_FILE }} | wc --lines)
+
$(comm -12 <(grep --extended-regexp '^[^#]*[[:alnum:]]' ${{ env.MAIN_RUN_FILE }} | sort) <(grep --extended-regexp '^[^#]*[[:alnum:]]' ${{ env.TESTSUITE_RUN_FILE }} | sort) | wc --lines)
)
))%" >> $GITHUB_ENV
env:
MAIN_RUN_FILE: "run.sh"
COMMON_RUN_FILE: "./src/common.sh"
TESTSUITE_RUN_FILE: "./tests/testsuite/roles/testing/files/system.sh"
- name: "Generate badge"
uses: "schneegans/[email protected]"
with:
auth: "${{ secrets.GIST_SECRET }}"
gistID: "d4fd269e226b0ed70954f861129a2756"
filename: "superset-cluster-codecoverage.json"
label: "System Tests Coverage"
message: "${{ env.COVERAGE }}"
valColorRange: "${{ env.COVERAGE }}"
maxColorRange: 100
minColorRange: 0