Skip to content

Commit 1fd3be9

Browse files
Merge pull request #154 from chethann007/gh-actions
#SBCOSS-427 feat: adding github actions
2 parents 570c96e + fab91ed commit 1fd3be9

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

.github/workflows/pr-actions.yml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
11
name: PR Coverage Check
22

33
on:
4-
pull_request:
5-
types: [opened, synchronize]
6-
workflow_dispatch:
4+
pull_request:
5+
branches:
6+
- '**'
77

88
jobs:
99
coverage:
1010
runs-on: ubuntu-latest
11-
env:
12-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
1311
steps:
14-
- name: Degug SONAR_TOKEN
15-
run: echo $SONAR_TOKEN
12+
- name: Checkout code
13+
uses: actions/checkout@v3
1614

17-
- uses: actions/checkout@v3
18-
- name: Set up JDK11
15+
- name: Set up JDK 11
1916
uses: actions/setup-java@v3
2017
with:
2118
java-version: '11'
2219
distribution: 'temurin'
23-
cache: 'maven'
20+
cache: 'maven'
2421

2522
- name: Build and Generate Coverage Report
2623
run: |
@@ -29,14 +26,15 @@ jobs:
2926
- name: Set up JDK 17
3027
uses: actions/setup-java@v2
3128
with:
32-
distribution: 'temurin'
3329
java-version: '17'
34-
30+
distribution: 'temurin'
31+
3532
- name: Run SonarQube analysis
33+
env:
34+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
3635
run: |
3736
mvn sonar:sonar \
3837
-Dsonar.projectKey=sunbird-lern \
3938
-Dsonar.organization=sunbird-lern \
40-
-Dsonar.login=$SONAR_TOKEN \
4139
-Dsonar.host.url=https://sonarcloud.io \
4240
-Dsonar.coverage.jacoco.xmlReportPaths=all-actors/target/site/jacoco/jacoco.xml,notification-sdk/target/site/jacoco/jacoco.xml,service/target/site/jacoco/jacoco.xml

0 commit comments

Comments
 (0)