Skip to content

Commit 392686e

Browse files
committed
SONARPY-3418 test new GH action build pipeline
1 parent 3ce6a39 commit 392686e

3 files changed

Lines changed: 90 additions & 0 deletions

File tree

.github/workflows/build.yml

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