diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 627709ca0..cd0c260b6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,20 +31,20 @@ jobs: - uses: actions/checkout@v2 - name: Set Image Version run: echo "IMAGE_VERSION=${GITHUB_SHA:0:7}" >> $GITHUB_ENV - # - name: Build CLI - # run: yarn --cwd cli - # - name: Build Web UI Image - # run: docker build -t $WEBUI_TAG:$IMAGE_VERSION webui - # - name: Run Server Tests - # run: server/gradlew --no-daemon -p server check - # - name: Build Server Image - # run: docker build -t $SERVER_TAG:$IMAGE_VERSION server - # - name: Push Docker Images - # run: | - # echo ${{ secrets.BOT_ACCESS_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin - # docker push $SERVER_TAG:$IMAGE_VERSION - # docker push $WEBUI_TAG:$IMAGE_VERSION - # if: github.repository == 'eclipse/openvsx' && github.ref == 'refs/heads/master' + - name: Build CLI + run: yarn --cwd cli + - name: Build Web UI Image + run: docker build -t $WEBUI_TAG:$IMAGE_VERSION webui + - name: Run Server Tests + run: server/gradlew --no-daemon -p server check + - name: Build Server Image + run: docker build -t $SERVER_TAG:$IMAGE_VERSION server + - name: Push Docker Images + run: | + echo ${{ secrets.BOT_ACCESS_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin + docker push $SERVER_TAG:$IMAGE_VERSION + docker push $WEBUI_TAG:$IMAGE_VERSION + if: github.repository == 'eclipse/openvsx' && github.ref == 'refs/heads/master' - name: Save PR number to file if: github.event_name == 'pull_request' run: echo ${{ github.event.number }} > PR_NUMBER.txt diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index 5a313be5f..b9f5c5b23 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -59,16 +59,14 @@ jobs: restore-keys: ${{ runner.os }}-gradle - name: Make server libraries directory run: mkdir server/libraries - - name: Copy server libraries #TODO remove after debugging + - name: Copy server libraries run: find ~/.gradle/caches -type f -name '*.jar' -exec cp {} server/libraries \; - - name: List Files #TODO remove after debugging - run: ls -al server/libraries - name: Set up JDK uses: actions/setup-java@v1 with: java-version: 17 - - name: Build Server - run: server/gradlew --no-daemon -p server compileJava compileScala compileTestJava compileTestScala + - name: Generate JaCoCo test report + run: server/gradlew --no-daemon -p server jacocoTestReport - name: SonarCloud Scan on PR if: github.event.workflow_run.event == 'pull_request' uses: sonarsource/sonarcloud-github-action@master diff --git a/cli/package.json b/cli/package.json index d750931d3..0942d044c 100644 --- a/cli/package.json +++ b/cli/package.json @@ -18,7 +18,7 @@ "bugs": "https://github.com/eclipse/openvsx/issues", "contributors": [ { - "name": "Miro Sp�nemann", + "name": "Miro Spönemann", "email": "miro.spoenemann@typefox.io", "url": "https://www.typefox.io" } diff --git a/server/build.gradle b/server/build.gradle index 23c760265..2eafae447 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -7,6 +7,7 @@ buildscript { } } plugins { + id 'jacoco' id 'nu.studer.jooq' version '8.2.1' id 'de.undercouch.download' version '5.4.0' id 'org.springframework.boot' version '3.1.0' @@ -177,5 +178,13 @@ task unitTests(type: Test) { exclude 'org/eclipse/openvsx/repositories/RepositoryServiceSmokeTest.class' } +jacocoTestReport { + reports { + xml.required = true + } + + dependsOn test // tests are required to run before generating the report +} + apply from: 'dependencies.gradle' apply from: 'test-extensions.gradle' diff --git a/sonar-project.properties b/sonar-project.properties index eeef30959..d9cad0642 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -6,6 +6,7 @@ sonar.java.binaries=server/build/classes/java/main sonar.java.libraries=server/libraries/*.jar sonar.java.test.binaries=server/build/classes/java/test sonar.java.test.libraries=server/libraries/*.jar +sonar.coverage.jacoco.xmlReportPaths=server/build/reports/jacoco/test/jacocoTestReport.xml # This is the name and version displayed in the SonarCloud UI. #sonar.projectName=openvsx