Skip to content

Server endpoints v2 returning the checkpoins data of a partitioning: 190 #815

Server endpoints v2 returning the checkpoins data of a partitioning: 190

Server endpoints v2 returning the checkpoins data of a partitioning: 190 #815

Workflow file for this run

#
# Copyright 2021 ABSA Group Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: JaCoCo report agent and module
on:
pull_request:
branches: [ master ]
types: [ opened, edited, synchronize, reopened ]
env:
scalaLong12: 2.13.11
scalaShort12: "2.13"
jaCocoReportVersion: "v1.6.1"
overall: 60.0
changed: 80.0
jobs:
test:
name: Build and test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Scala
uses: olafurpg/setup-scala@v14
with:
java-version: "adopt@1.8"
- name: Build and run tests
continue-on-error: true
id: jacocorun
run: |
sbt "project agent; jacoco"
sbt "project model; jacoco"
# agent module code coverage
- name: Add coverage to PR
if: steps.jacocorun.outcome == 'success'
id: jacoco-agent
uses: madrapps/jacoco-report@${{ env.jaCocoReportVersion }}

Check failure on line 53 in .github/workflows/jacoco_check.yml

View workflow run for this annotation

GitHub Actions / JaCoCo report agent and module

Invalid workflow file

The workflow is not valid. .github/workflows/jacoco_check.yml (Line: 53, Col: 15): Unrecognized named-value: 'env'. Located at position 1 within expression: env.jaCocoReportVersion .github/workflows/jacoco_check.yml (Line: 66, Col: 15): Unrecognized named-value: 'env'. Located at position 1 within expression: env.jaCocoReportVersion
with:
name: agent-jacoco-report
paths: ${{ github.workspace }}/agent/target/jvm-${{ env.scalaShort12 }}/jacoco/report/jacoco.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: ${{ env.overall }}
min-coverage-changed-file: ${{ env.changed }}
title: JaCoCo agent module code coverage report - scala ${{ env.scalaLong12 }}
update-comment: true
# model module code coverage
- name: Add coverage to PR
if: steps.jacocorun.outcome == 'success'
id: jacoco-model
uses: madrapps/jacoco-report@${{ env.jaCocoReportVersion }}
with:
name: model-jacoco-report
paths: ${{ github.workspace }}/model/target/jvm-${{ env.scalaShort12 }}/jacoco/report/jacoco.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: ${{ env.overall }}
min-coverage-changed-file: ${{ env.changed }}
title: JaCoCo model module code coverage report - scala ${{ env.scalaLong12 }}
update-comment: true
- name: Get the Coverage info
if: steps.jacocorun.outcome == 'success'
run: |
echo "Total agent module coverage ${{ steps.jacoco-agent.outputs.coverage-overall }}"
echo "Changed Files coverage ${{ steps.jacoco-agent.outputs.coverage-changed-files }}"
echo "Total model module coverage ${{ steps.jacoco-model.outputs.coverage-overall }}"
echo "Changed Files coverage ${{ steps.jacoco-model.outputs.coverage-changed-files }}"
- name: Fail PR if changed files coverage is less than ${{ env.changed }}%
if: steps.jacocorun.outcome == 'success'
uses: actions/github-script@v6
with:
script: |
const coverageCheckFailed =
Number('${{ steps.jacoco-agent.outputs.coverage-changed-files }}') < Number('${{ env.changed }}') ||
Number('${{ steps.jacoco-model.outputs.coverage-changed-files }}') < Number('${{ env.changed }}');
if (coverageCheckFailed) {
core.setFailed('Changed files coverage is less than ${{ env.changed }}%!');
}
- name: Edit JaCoCo comments on build failure
if: steps.jacocorun.outcome != 'success'
uses: actions/github-script@v6
with:
script: |
const issue_number = context.issue.number;
const owner = context.repo.owner;
const repo = context.repo.repo;
const jacocoReportRegExp = /^### JaCoCo .* code coverage report .*/;
const comments = await github.rest.issues.listComments({
owner,
repo,
issue_number,
});
for (const comment of comments.data) {
const lines = comment.body.split('\n');
if (lines.length > 0 && jacocoReportRegExp.test(lines[0])) {
await github.rest.issues.updateComment({
owner,
repo,
comment_id: comment.id,
body: lines[0] + "\n\n### Build Failed",
});
}
}
core.setFailed('JaCoCo test coverage report generation failed, and related PR comments were updated.');