Skip to content

Commit 83be6d7

Browse files
committed
fixups
1 parent 1b23bd9 commit 83be6d7

File tree

3 files changed

+26
-10
lines changed

3 files changed

+26
-10
lines changed

.github/workflows/main-sonar-check.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ jobs:
3636
fetch-depth: 0
3737
- name: Setup Environment
3838
uses: ./.github/actions/setup-env
39+
with:
40+
install-python: 'true'
41+
install-apt-deps: 'true'
3942
- name: Cache SonarCloud packages
4043
uses: actions/cache@v5
4144
with:
@@ -45,9 +48,13 @@ jobs:
4548
- name: Install Non-OSS
4649
uses: ./.github/actions/install-nonoss
4750
- name: Run Build and Tests with Coverage
48-
run: |
49-
mvn -T$(nproc) -P quality -Dsimulator -Dnoredist clean install org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=apache_cloudstack
50-
- uses: codecov/codecov-action@v5
51+
run: mvn -B -T$(nproc) -P developer,systemvm,quality -Dsimulator -Dnoredist clean install
52+
- name: Upload to SonarQube
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
56+
run: mvn -B -P quality org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=apache_cloudstack -Dsonar.branch.name=${{ github.ref_name }}
57+
- uses: codecov/codecov-action@v4
5158
with:
5259
files: ./client/target/site/jacoco-aggregate/jacoco.xml
5360
fail_ci_if_error: true

.github/workflows/pre-commit.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,17 @@ jobs:
3333
steps:
3434
- name: Check Out
3535
uses: actions/checkout@v6
36+
- name: Set up Python
37+
uses: actions/setup-python@v6
38+
with:
39+
python-version: '3.11'
40+
cache: 'pip'
3641
- name: Install
37-
run: |
38-
python -m pip install --upgrade pip
39-
pip install pre-commit
42+
run: pip install pre-commit
4043
- name: Set PY
4144
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
42-
- uses: actions/cache@v5
45+
- name: Cache pre-commit environments
46+
uses: actions/cache@v5
4347
with:
4448
path: ~/.cache/pre-commit
4549
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}

.github/workflows/sonar-check.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ concurrency:
2626
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
2727
jobs:
2828
build:
29-
if: github.repository == 'apache/cloudstack' && github.event.pull_request.head.repo.full_name == github.repository
3029
name: Sonar JaCoCo Coverage
3130
runs-on: ubuntu-24.04
3231
steps:
@@ -35,6 +34,9 @@ jobs:
3534
fetch-depth: 0
3635
- name: Setup Environment
3736
uses: ./.github/actions/setup-env
37+
with:
38+
install-python: 'true'
39+
install-apt-deps: 'true'
3840
- name: Cache SonarCloud packages
3941
uses: actions/cache@v5
4042
with:
@@ -44,14 +46,17 @@ jobs:
4446
- name: Install Non-OSS
4547
uses: ./.github/actions/install-nonoss
4648
- name: Run Build and Tests with Coverage
49+
run: mvn -B -T$(nproc) -P developer,systemvm,quality -Dsimulator -Dnoredist clean install
50+
- name: Upload to SonarQube
51+
if: github.repository == 'apache/cloudstack' && github.event.pull_request.head.repo.full_name == github.repository
4752
env:
4853
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4954
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
5055
PR_ID: ${{ github.event.pull_request.number }}
5156
HEADREF: ${{ github.event.pull_request.head.ref }}
5257
run: |
53-
mvn -T$(nproc) -P quality -Dsimulator -Dnoredist clean install org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=apache_cloudstack -Dsonar.pullrequest.key="$PR_ID" -Dsonar.pullrequest.branch="$HEADREF" -Dsonar.pullrequest.github.repository=apache/cloudstack -Dsonar.pullrequest.provider=GitHub -Dsonar.pullrequest.github.summary_comment=true
54-
- uses: codecov/codecov-action@v5
58+
mvn -B -P quality org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=apache_cloudstack -Dsonar.pullrequest.key="$PR_ID" -Dsonar.pullrequest.branch="$HEADREF" -Dsonar.pullrequest.github.repository=apache/cloudstack -Dsonar.pullrequest.provider=GitHub -Dsonar.pullrequest.github.summary_comment=true
59+
- uses: codecov/codecov-action@v4
5560
with:
5661
files: ./client/target/site/jacoco-aggregate/jacoco.xml
5762
fail_ci_if_error: true

0 commit comments

Comments
 (0)