Skip to content

Commit 27a08b2

Browse files
authored
1 parent 7ab9978 commit 27a08b2

File tree

4 files changed

+361
-290
lines changed

4 files changed

+361
-290
lines changed

.github/workflows/master.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ jobs:
1010
build-test:
1111
name: Build & Test
1212
runs-on: ubuntu-latest
13-
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
1413
concurrency: ci-${{ github.ref }}
1514

1615
steps:
@@ -40,6 +39,7 @@ jobs:
4039
uses: sonarsource/[email protected]
4140
env:
4241
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
42+
if: env.SONAR_TOKEN != ''
4343

4444
docker:
4545
name: Publish Docker Image

.github/workflows/sonar.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Manual SonarCloud Analysis
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
pr_id:
7+
description: 'Pull Request ID to analyze'
8+
required: true
9+
type: string
10+
11+
jobs:
12+
sonar-analysis:
13+
name: SonarCloud Analysis for PR
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Get PR details
18+
id: pr
19+
uses: actions/github-script@v7
20+
with:
21+
script: |
22+
const pr = await github.rest.pulls.get({
23+
owner: context.repo.owner,
24+
repo: context.repo.repo,
25+
pull_number: ${{ inputs.pr_id }}
26+
});
27+
core.setOutput('head_ref', pr.data.head.ref);
28+
core.setOutput('base_ref', pr.data.base.ref);
29+
core.setOutput('head_sha', pr.data.head.sha);
30+
31+
- uses: actions/checkout@v4
32+
with:
33+
ref: ${{ steps.pr.outputs.head_sha }}
34+
fetch-depth: 0
35+
36+
- name: Set up Python 3.13
37+
uses: actions/setup-python@v5
38+
with:
39+
python-version: "3.13"
40+
41+
- name: Install dependencies
42+
run: |
43+
pip install pipenv
44+
pipenv install --dev
45+
46+
- name: Test
47+
run: pipenv run pytest -v --cov=./ --cov-report xml
48+
49+
- name: Fix code coverage path
50+
working-directory: ./
51+
run: sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' coverage.xml
52+
53+
- name: SonarCloud Scan
54+
uses: sonarsource/[email protected]
55+
env:
56+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
57+
if: env.SONAR_TOKEN != ''
58+
with:
59+
args: >
60+
-Dsonar.pullrequest.key=${{ inputs.pr_id }}
61+
-Dsonar.pullrequest.branch=${{ steps.pr.outputs.head_ref }}
62+
-Dsonar.pullrequest.base=${{ steps.pr.outputs.base_ref }}

Pipfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ name = "pypi"
77
slack-bolt = "==1.23.0"
88
python-dotenv = "==1.1.1"
99
gunicorn = "==23.0.0"
10-
flask = "==3.1.1"
11-
requests = "==2.32.4"
10+
flask = "==3.1.2"
11+
requests = "==2.32.5"
1212
pyjwt = "==2.10.1"
13-
gql = "==3.5.3"
13+
gql = "==4.0.0"
1414

1515
# Managed dependencies and security patches
1616
requests-toolbelt = "==1.0.0"

0 commit comments

Comments
 (0)