Skip to content

Commit 248ac4d

Browse files
ci workflow (#1133)
# Description Set CI workflow ### Jira Issue: [PLATTA-6702](https://helsinkisolutionoffice.atlassian.net/browse/PLATTA-6702) ## Type of change - [ ] Bug fix - [ ] New feature - [ ] Other # Instructions for testing Please describe tests how this change or new feature can be tested. # Checklist: - [ ] I have written new tests (if applicable) - [ ] I have ran the tests myself (if applicable) - [ ] I have made necessary changes to the documentation, link to confluence or other location: # Other relevant info Please describe here if there is e.g. some requirements for this change or other info that the tester/user needs to know. [PLATTA-6702]: https://helsinkisolutionoffice.atlassian.net/browse/PLATTA-6702?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
2 parents 8940baf + bac2e85 commit 248ac4d

2 files changed

Lines changed: 52 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, dev ]
6+
pull_request:
7+
branches: [ main, dev ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
tests:
12+
name: Test
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Use Java version 17
18+
uses: actions/setup-java@v3
19+
with:
20+
distribution: 'temurin'
21+
java-version: '17'
22+
cache: 'gradle'
23+
24+
# run tests
25+
- name: Make Gradle executable
26+
run: chmod +x gradlew
27+
28+
- name: Run unit & integration tests with coverage
29+
run: ./gradlew :services:hanke-service:test :services:hanke-service:integrationTest :services:hanke-service:jacocoTestReport --no-daemon --info
30+
31+
- name: Publish JUnit test results
32+
uses: EnricoMi/publish-unit-test-result-action@v2
33+
if: always()
34+
with:
35+
files: |
36+
**/build/test-results/test/*.xml
37+
**/build/test-results/integrationTest/*.xml
38+
39+
- name: SonarQube Cloud Scan
40+
uses: SonarSource/sonarqube-scan-action@v6
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

sonar-project.properties

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# SonarCloud Configuration
2+
sonar.organization=city-of-helsinki
3+
sonar.projectKey=City-of-Helsinki_haitaton-backend
4+
5+
sonar.exclusions=services/hanke-service/src/main/resources/application.yml
6+
sonar.java.coveragePlugin=jacoco
7+
sonar.coverage.jacoco.xmlReportPaths=$(Build.SourcesDirectory)/services/hanke-service/build/reports/jacoco/test/jacocoTestReport.xml
8+
sonar.coverage.exclusions=services/hanke-service/src/test/**,services/hanke-service/src/integrationTest/**,scripts/**/*.py
9+
sonar.cpd.exclusions=scripts/docker-postgres/*.sql,services/hanke-service/src/integrationTest/**/*.sql,services/hanke-service/src/test/kotlin/fi/hel/haitaton/hanke/factory/**

0 commit comments

Comments
 (0)