Skip to content

Commit 68a2b49

Browse files
committed
Fix after review
1 parent b215d0b commit 68a2b49

File tree

4 files changed

+62
-42
lines changed

4 files changed

+62
-42
lines changed

.github/actions/config-poetry-win/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ runs:
3030
- uses: SonarSource/ci-github-actions/get-build-number@v1
3131
id: get_build_number
3232
- name: Cache local Poetry cache
33-
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
33+
uses: SonarSource/ci-github-actions/cache@v1
3434
with:
3535
path: ${{ inputs.poetry-cache-dir }}
3636
key: poetry-${{ runner.os }}-${{ hashFiles('poetry.lock') }}

.github/actions/config-poetry/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ runs:
3333
- uses: SonarSource/ci-github-actions/get-build-number@v1
3434
id: get_build_number
3535
- name: Cache local Poetry cache
36-
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
36+
uses: SonarSource/ci-github-actions/cache@v1
3737
with:
3838
path: ${{ inputs.poetry-cache-dir }}
3939
key: poetry-${{ runner.os }}-${{ hashFiles('poetry.lock') }}
4040
restore-keys: poetry-${{ runner.os }}-
41-
- uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0
41+
- name: Install mise and tools
42+
uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0
4243
with:
4344
version: 2025.7.12
44-
install_args: "jfrog-cli@${{ inputs.jfrog-version }} poetry@${{ inputs.poetry-version }}"
4545
- name: Vault
4646
# yamllint disable rule:line-length
4747
id: secrets

.github/workflows/build.yml

Lines changed: 55 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ jobs:
1919
id-token: write
2020
contents: write
2121
steps:
22-
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
23-
- uses: jdx/mise-action@e3d7b8d67a7958d1207f6ed871e83b1ea780e7b0 #v3.3.1
24-
with:
25-
install_args: "[email protected]"
26-
- run: mise use -g [email protected]
27-
- uses: SonarSource/ci-github-actions/build-poetry@v1
22+
- name: Checkout repository
23+
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
24+
- name: Install mise and tools
25+
uses: jdx/mise-action@e3d7b8d67a7958d1207f6ed871e83b1ea780e7b0 #v3.3.1
26+
- name: Build the scanner
27+
uses: SonarSource/ci-github-actions/build-poetry@v1
2828
id: build-poetry
2929
with:
3030
sonar-platform: none
@@ -33,14 +33,16 @@ jobs:
3333
deploy-pull-request: true
3434

3535
install_deps:
36-
name: "Install Dependencies"
36+
name: "Install and Cache Poetry Dependencies"
3737
runs-on: github-ubuntu-latest-s
3838
permissions:
3939
id-token: write
4040
contents: write
4141
steps:
42-
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
43-
- uses: ./.github/actions/config-poetry
42+
- name: Checkout repository
43+
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
44+
- name: Configure poetry for Windows
45+
uses: ./.github/actions/config-poetry # We use this job to cache the poetry depend
4446
- run: |
4547
poetry install
4648
@@ -52,8 +54,10 @@ jobs:
5254
id-token: write
5355
contents: write
5456
steps:
55-
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
56-
- uses: ./.github/actions/config-poetry
57+
- name: Checkout repository
58+
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
59+
- name: Configure poetry for Windows
60+
uses: ./.github/actions/config-poetry
5761
- run: |
5862
poetry run black src/ tests/ --check
5963
poetry run licenseheaders -t license_header.tmpl -o "SonarSource SA" -y 2011-2024 -n "Sonar Scanner Python" -E .py -d src/
@@ -68,12 +72,12 @@ jobs:
6872
id-token: write
6973
contents: read
7074
steps:
71-
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
72-
- uses: jdx/mise-action@e3d7b8d67a7958d1207f6ed871e83b1ea780e7b0 #v3.3.1
73-
with:
74-
install_args: "[email protected]"
75-
- run: mise use -g [email protected]
76-
- run: |
75+
- name: Checkout repository
76+
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
77+
- name: Install mise and tools
78+
uses: jdx/mise-action@e3d7b8d67a7958d1207f6ed871e83b1ea780e7b0 #v3.3.1
79+
- name: Check for incorrect documentation
80+
run: |
7781
poetry run python tools/generate_cli_documentation.py
7882
git diff --exit-code CLI_ARGS.md
7983
@@ -85,8 +89,10 @@ jobs:
8589
id-token: write
8690
contents: write
8791
steps:
88-
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
89-
- uses: ./.github/actions/config-poetry
92+
- name: Checkout repository
93+
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
94+
- name: Configure poetry
95+
uses: ./.github/actions/config-poetry
9096
- run: |
9197
poetry run pytest --cov-report=xml:coverage.xml --cov-config=pyproject.toml --cov=src --cov-branch tests
9298
poetry run mypy src/ > mypy-report.txt || true
@@ -106,16 +112,16 @@ jobs:
106112
id-token: write
107113
contents: write
108114
steps:
109-
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
115+
- name: Checkout repository
116+
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
110117
- name: Download coverage artifacts
111118
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
112119
with:
113120
name: coverage-reports
114-
- uses: jdx/mise-action@e3d7b8d67a7958d1207f6ed871e83b1ea780e7b0 #v3.3.1
115-
with:
116-
install_args: "[email protected]"
117-
- run: mise use -g [email protected]
118-
- uses: SonarSource/ci-github-actions/build-poetry@v1
121+
- name: Install mise and tools
122+
uses: jdx/mise-action@e3d7b8d67a7958d1207f6ed871e83b1ea780e7b0 #v3.3.1
123+
- name: Analysis the project on next
124+
uses: SonarSource/ci-github-actions/build-poetry@v1
119125
with:
120126
sonar-platform: next
121127
artifactory-reader-role: private-reader
@@ -132,9 +138,12 @@ jobs:
132138
matrix:
133139
python-version: ["3.9.18", "3.9.6", "3.10.13", "3.11.7", "3.12.1", "3.13.2"]
134140
steps:
135-
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
136-
- uses: ./.github/actions/config-poetry
137-
- run: |
141+
- name: Checkout repository
142+
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
143+
- name: Configure poetry
144+
uses: ./.github/actions/config-poetry
145+
- name: Execute the test suite
146+
run: |
138147
poetry run pytest tests/
139148
140149
qa-windows:
@@ -145,35 +154,43 @@ jobs:
145154
id-token: write
146155
contents: write
147156
steps:
148-
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
149-
- uses: ./.github/actions/config-poetry-win
150-
- run: |
157+
- name: Checkout repository
158+
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
159+
- name: Configure poetry for Windows
160+
uses: ./.github/actions/config-poetry-win
161+
- name: Execute the test suite
162+
run: |
151163
poetry run pytest tests/
152164
153-
154165
its:
155166
name: "Integration Tests"
156167
runs-on: github-ubuntu-latest-s
157168
permissions:
158169
id-token: write
159170
contents: write
160171
steps:
161-
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
172+
- name: Checkout repository
173+
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
162174
- name: Cache SonarQube
163-
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
175+
uses: SonarSource/ci-github-actions/cache@v1
176+
id: sonarqube-cache
164177
with:
165178
path: sonarqube_cache/
166179
key: sonarqube-25.3.0.104237
180+
restore-keys: cache-${{ runner.os }}-
167181
- name: Download SonarQube
182+
if: ${{ !steps.sonarqube-cache.outputs.cache-hit }}
168183
run: |
169184
mkdir -p sonarqube_cache
170185
if [ ! -f sonarqube_cache/sonarqube.zip ]; then
171186
wget -q https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-25.3.0.104237.zip -O sonarqube_cache/sonarqube.zip
172187
fi
173188
env:
174189
SONARQUBE_VERSION: 25.3.0.104237
175-
- uses: ./.github/actions/config-poetry
176-
- run: ./.github/scripts/run_its.sh
190+
- name: Configure poetry
191+
uses: ./.github/actions/config-poetry
192+
- name: Execute the integration tests
193+
run: ./.github/scripts/run_its.sh
177194

178195
promote:
179196
name: "Promote"
@@ -183,8 +200,8 @@ jobs:
183200
id-token: write
184201
contents: write
185202
steps:
186-
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
187-
- uses: SonarSource/ci-github-actions/promote@v1
203+
- name: Promote
204+
uses: SonarSource/ci-github-actions/promote@v1
188205
with:
189206
promote-pull-request: true
190207
build-name: sonar-scanner-python

mise.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[tools]
2+
jfrog-cli = "2.77.0"
3+
poetry = "2.2.1"

0 commit comments

Comments
 (0)