Skip to content

Commit 1956a7d

Browse files
committed
Enable build and test
Add JaCoCo for test coverage
1 parent 7d21a7b commit 1956a7d

File tree

5 files changed

+28
-20
lines changed

5 files changed

+28
-20
lines changed

.github/workflows/main.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,20 @@ jobs:
3131
- uses: actions/checkout@v2
3232
- name: Set Image Version
3333
run: echo "IMAGE_VERSION=${GITHUB_SHA:0:7}" >> $GITHUB_ENV
34-
# - name: Build CLI
35-
# run: yarn --cwd cli
36-
# - name: Build Web UI Image
37-
# run: docker build -t $WEBUI_TAG:$IMAGE_VERSION webui
38-
# - name: Run Server Tests
39-
# run: server/gradlew --no-daemon -p server check
40-
# - name: Build Server Image
41-
# run: docker build -t $SERVER_TAG:$IMAGE_VERSION server
42-
# - name: Push Docker Images
43-
# run: |
44-
# echo ${{ secrets.BOT_ACCESS_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
45-
# docker push $SERVER_TAG:$IMAGE_VERSION
46-
# docker push $WEBUI_TAG:$IMAGE_VERSION
47-
# if: github.repository == 'eclipse/openvsx' && github.ref == 'refs/heads/master'
34+
- name: Build CLI
35+
run: yarn --cwd cli
36+
- name: Build Web UI Image
37+
run: docker build -t $WEBUI_TAG:$IMAGE_VERSION webui
38+
- name: Run Server Tests
39+
run: server/gradlew --no-daemon -p server check
40+
- name: Build Server Image
41+
run: docker build -t $SERVER_TAG:$IMAGE_VERSION server
42+
- name: Push Docker Images
43+
run: |
44+
echo ${{ secrets.BOT_ACCESS_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
45+
docker push $SERVER_TAG:$IMAGE_VERSION
46+
docker push $WEBUI_TAG:$IMAGE_VERSION
47+
if: github.repository == 'eclipse/openvsx' && github.ref == 'refs/heads/master'
4848
- name: Save PR number to file
4949
if: github.event_name == 'pull_request'
5050
run: echo ${{ github.event.number }} > PR_NUMBER.txt

.github/workflows/sonar.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,14 @@ jobs:
5959
restore-keys: ${{ runner.os }}-gradle
6060
- name: Make server libraries directory
6161
run: mkdir server/libraries
62-
- name: Copy server libraries #TODO remove after debugging
62+
- name: Copy server libraries
6363
run: find ~/.gradle/caches -type f -name '*.jar' -exec cp {} server/libraries \;
64-
- name: List Files #TODO remove after debugging
65-
run: ls -al server/libraries
6664
- name: Set up JDK
6765
uses: actions/setup-java@v1
6866
with:
6967
java-version: 17
70-
- name: Build Server
71-
run: server/gradlew --no-daemon -p server compileJava compileScala compileTestJava compileTestScala
68+
- name: Generate JaCoCo test report
69+
run: server/gradlew --no-daemon -p server jacocoTestReport
7270
- name: SonarCloud Scan on PR
7371
if: github.event.workflow_run.event == 'pull_request'
7472
uses: sonarsource/sonarcloud-github-action@master

cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"bugs": "https://github.com/eclipse/openvsx/issues",
1919
"contributors": [
2020
{
21-
"name": "Miro Sp�nemann",
21+
"name": "Miro Spönemann",
2222
"email": "[email protected]",
2323
"url": "https://www.typefox.io"
2424
}

server/build.gradle

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ buildscript {
77
}
88
}
99
plugins {
10+
id 'jacoco'
1011
id 'nu.studer.jooq' version '8.2.1'
1112
id 'de.undercouch.download' version '5.4.0'
1213
id 'org.springframework.boot' version '3.1.0'
@@ -177,5 +178,13 @@ task unitTests(type: Test) {
177178
exclude 'org/eclipse/openvsx/repositories/RepositoryServiceSmokeTest.class'
178179
}
179180

181+
jacocoTestReport {
182+
reports {
183+
xml.required = true
184+
}
185+
186+
dependsOn test // tests are required to run before generating the report
187+
}
188+
180189
apply from: 'dependencies.gradle'
181190
apply from: 'test-extensions.gradle'

sonar-project.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ sonar.java.binaries=server/build/classes/java/main
66
sonar.java.libraries=server/libraries/*.jar
77
sonar.java.test.binaries=server/build/classes/java/test
88
sonar.java.test.libraries=server/libraries/*.jar
9+
sonar.coverage.jacoco.xmlReportPaths=server/build/reports/jacoco/test/jacocoTestReport.xml
910

1011
# This is the name and version displayed in the SonarCloud UI.
1112
#sonar.projectName=openvsx

0 commit comments

Comments
 (0)