Skip to content

Commit 26e542d

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

3 files changed

Lines changed: 91 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
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+
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
20+
cancel-in-progress: true
21+
22+
jobs:
23+
analyze:
24+
runs-on: github-ubuntu-latest-s
25+
name: Build
26+
permissions:
27+
id-token: write
28+
contents: write
29+
strategy:
30+
matrix:
31+
include:
32+
- 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+
- 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"
42+
- 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"
47+
steps:
48+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
49+
50+
- name: Setup submodules
51+
run: |
52+
git submodule update --init --jobs 4
53+
cd python-frontend/typeshed_serializer/resources/python-type-stubs
54+
git sparse-checkout set stubs/sklearn
55+
git checkout
56+
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+
64+
- uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0
65+
with:
66+
version: 2025.7.12
67+
68+
- name: Install tox
69+
run: |
70+
uv python install ${{ env.PYTHON_VERSION }} --default --preview
71+
uv venv
72+
uv pip install tox
73+
source .venv/bin/activate
74+
echo "$(pwd)/.venv/bin" >> $GITHUB_PATH
75+
76+
- name: Remove private directory
77+
run: rm -rf private
78+
79+
80+
- name: Analyze
81+
run: bash ./.cirrus/analyze.sh
82+
env:
83+
IS_COMMUNITY: true
84+
SONAR_TOKEN: ${{ fromJson(steps.secrets.outputs.vault).SONAR_TOKEN }}
85+
SONAR_HOST_URL: ${{ matrix.sonar_host_url }}
86+
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)