Skip to content

Commit 38b5e8c

Browse files
Seppli11sonartech
authored andcommitted
SONARPY-3418 Migrate the public CI to GH action (#554)
GitOrigin-RevId: 73705dcdfb9465f5d8fc39efbf57bb0ca215ce36
1 parent a257112 commit 38b5e8c

4 files changed

Lines changed: 90 additions & 80 deletions

File tree

.cirrus-public.yml

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

.cirrus.star

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ def is_public_repo():
3131

3232
def main(ctx):
3333
if is_public_repo():
34-
return public_conf(ctx)
34+
return {}
3535
else:
36-
return private_conf(ctx)
36+
return private_conf(ctx)

.github/workflows/build.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Build
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- branch-*
7+
- dogfood-*
8+
workflow_dispatch:
9+
schedule:
10+
# Nightly build at 2 AM UTC for shadow analysis
11+
- cron: '0 2 * * *'
12+
13+
env:
14+
PYTHON_VERSION: 3.9.5
15+
IS_COMMUNITY: true
16+
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
19+
cancel-in-progress: true
20+
21+
jobs:
22+
analyze:
23+
runs-on: github-ubuntu-latest-s
24+
name: Build
25+
permissions:
26+
id-token: write
27+
contents: write
28+
strategy:
29+
matrix:
30+
include:
31+
- name: "Analysis on SonarQube NEXT"
32+
sonar_token_path: "development/kv/data/next"
33+
sonar_host_url: "https://next.sonarqube.com/sonarqube"
34+
sonar_project_key: "org.sonarsource.python:python"
35+
run_condition: "always"
36+
- name: "Analysis on Sonarcloud.io"
37+
sonar_token_path: "development/kv/data/sonarcloud"
38+
sonar_host_url: "https://sonarcloud.io"
39+
sonar_project_key: "SonarSource_sonar-python"
40+
run_condition: "nightly"
41+
- name: "Analysis on SonarQube.us"
42+
sonar_token_path: "development/kv/data/sonarqube-us"
43+
sonar_host_url: "https://sonarqube.us"
44+
sonar_project_key: "SonarSource_sonar-python"
45+
run_condition: "nightly"
46+
steps:
47+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
48+
49+
- name: Setup submodules
50+
run: |
51+
git submodule update --init --jobs 4
52+
cd python-frontend/typeshed_serializer/resources/python-type-stubs
53+
git sparse-checkout set stubs/sklearn
54+
git checkout
55+
56+
- name: Get sonar token
57+
id: secrets
58+
uses: SonarSource/vault-action-wrapper@v3
59+
with:
60+
secrets: |
61+
${{ matrix.sonar_token_path }} token | SONAR_TOKEN;
62+
63+
- uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0
64+
with:
65+
version: 2025.7.12
66+
67+
- name: Install tox
68+
run: |
69+
uv python install ${{ env.PYTHON_VERSION }} --default --preview
70+
uv venv
71+
uv pip install tox
72+
source .venv/bin/activate
73+
echo "$(pwd)/.venv/bin" >> $GITHUB_PATH
74+
75+
- name: Remove private directory
76+
run: rm -rf private
77+
78+
- name: Analyze
79+
run: bash ./.cirrus/analyze.sh
80+
env:
81+
SONAR_TOKEN: ${{ fromJson(steps.secrets.outputs.vault).SONAR_TOKEN }}
82+
SONAR_HOST_URL: ${{ matrix.sonar_host_url }}
83+
SONAR_PROJECT_KEY: ${{ matrix.sonar_project_key }}

mise.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[tools]
2+
java = "17.0"
3+
maven = "3.9"
4+
python = "3.13"
5+
uv = "latest"

0 commit comments

Comments
 (0)