-
Notifications
You must be signed in to change notification settings - Fork 1.9k
44 lines (38 loc) · 1.48 KB
/
sonarcloud-be-build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: code-check
on:
pull_request:
types: [labeled]
jobs:
sonarcloud-be:
runs-on: self-hosted
if: ${{ github.event.label.name == 'be-build' }}
env:
PR_NUMBER: ${{ github.event.number }}
steps:
- name: pre build
run: |
sudo rm -rf ../starrocks/*
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
be:
- 'be/**'
- name: set up
if: steps.changes.outputs.be == 'true'
run: |
time scp jenkins@ci01:~/userContent/be-build-$PR_NUMBER.tar.gz .
tar xzf be-build-$PR_NUMBER.tar.gz
workdir=$(pwd)
echo $workdir
sed -i "s|\/root\/starrocks|$workdir|g" be/build-wrapper/build-wrapper-dump.json
- name: Run sonar-scanner
if: steps.changes.outputs.be == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: f0fb4d25c03bae90c2e994c45c29c49dc86fc169
run: |
sonar-scanner -Dsonar.organization=starrocks -Dsonar.projectKey=Starrocks_be -Dsonar.cfamily.build-wrapper-output="be/build-wrapper" -Dsonar.host.url="https://sonarcloud.io" -Dsonar.sources="be/src" -Dsonar.pullrequest.key=${{ github.event.number }} -Dsonar.pullrequest.base=${{ github.base_ref }} -Dsonar.pullrequest.branch=${{ github.head_ref }} -Dsonar.projectBaseDir=. -Dsonar.pullrequest.github.repository=StarRocks/starrocks
- name: post build
run: |
sudo rm -rf ../starrocks/*