Skip to content

Commit 4326ee0

Browse files
joke1196sonartech
authored andcommitted
SONARPY-3826 Removed caching in sonar-python (#880)
GitOrigin-RevId: c5ac4fbf825d6f6a5db54e71e1f71012d25df7e3
1 parent ac5562d commit 4326ee0

3 files changed

Lines changed: 22 additions & 110 deletions

File tree

.cirrus/analyze.sh

Lines changed: 0 additions & 85 deletions
This file was deleted.

.github-commons/actions/analyze/action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ inputs:
77
sonar-project-key:
88
description: 'SonarQube project key'
99
required: true
10+
disable-caching:
11+
description: 'Disable caching'
12+
required: false
13+
default: 'false'
1014

1115
runs:
1216
using: 'composite'
@@ -20,3 +24,4 @@ runs:
2024
deploy: false
2125
sonar-platform: ${{ inputs.sonarqube-instance }}
2226
scanner-java-opts: '-Xmx1G'
27+
disable-caching: ${{ inputs.disable-caching }}

.github/workflows/build.yml

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
name: Build
2+
on:
3+
push:
4+
branches:
5+
name: Build
26
on:
37
push:
48
branches:
@@ -8,7 +12,7 @@ on:
812
workflow_dispatch:
913
schedule:
1014
# Nightly build at 2 AM UTC for shadow analysis
11-
- cron: '0 2 * * *'
15+
- cron: '0 2 * * *'
1216

1317
env:
1418
PYTHON_VERSION: 3.9.5
@@ -30,20 +34,14 @@ jobs:
3034
matrix:
3135
include:
3236
- name: "Analysis on SonarQube NEXT"
33-
sonar_token_path: "development/kv/data/next"
34-
sonar_host_url: "https://next.sonarqube.com/sonarqube"
35-
sonar_project_key: "org.sonarsource.python:python"
36-
run_condition: "always"
37+
sonarqube-instance: "next"
38+
sonar-project-key: "org.sonarsource.python:python"
3739
- name: "Analysis on Sonarcloud.io"
38-
sonar_token_path: "development/kv/data/sonarcloud"
39-
sonar_host_url: "https://sonarcloud.io"
40-
sonar_project_key: "SonarSource_sonar-python"
41-
run_condition: "nightly"
40+
sonarqube-instance: "sqc-eu"
41+
sonar-project-key: "SonarSource_sonar-python"
4242
- name: "Analysis on SonarQube.us"
43-
sonar_token_path: "development/kv/data/sonarqube-us"
44-
sonar_host_url: "https://sonarqube.us"
45-
sonar_project_key: "SonarSource_sonar-python"
46-
run_condition: "nightly"
43+
sonarqube-instance: "sqc-us"
44+
sonar-project-key: "SonarSource_sonar-python"
4745
steps:
4846
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
4947

@@ -54,25 +52,19 @@ jobs:
5452
git sparse-checkout set stubs/sklearn
5553
git checkout
5654
57-
- name: Get sonar token
58-
id: secrets
59-
uses: SonarSource/vault-action-wrapper@v3
60-
with:
61-
secrets: |
62-
${{ matrix.sonar_token_path }} token | SONAR_TOKEN;
63-
6455
- uses: jdx/mise-action@146a28175021df8ca24f8ee1828cc2a60f980bd5 # v3.5.1
6556
with:
6657
version: 2025.12.12
58+
cache: false
6759
env:
6860
MISE_ENV: test-and-analyze
6961

7062
- name: Remove private directory
7163
run: rm -rf private
7264

7365
- name: Analyze
74-
run: bash ./.cirrus/analyze.sh
75-
env:
76-
SONAR_TOKEN: ${{ fromJson(steps.secrets.outputs.vault).SONAR_TOKEN }}
77-
SONAR_HOST_URL: ${{ matrix.sonar_host_url }}
78-
SONAR_PROJECT_KEY: ${{ matrix.sonar_project_key }}
66+
uses: ./.github-commons/actions/analyze
67+
with:
68+
sonarqube-instance: ${{ matrix.sonarqube-instance }}
69+
sonar-project-key: ${{ matrix.sonar-project-key }}
70+
disable-caching: true

0 commit comments

Comments
 (0)