Skip to content

build-foresight-maven-jacoco-sample #798

build-foresight-maven-jacoco-sample

build-foresight-maven-jacoco-sample #798

Workflow file for this run

name: build-foresight-maven-jacoco-sample
on:
schedule:
- cron: "0 2 * * *"
workflow_dispatch:
env:
BRANCH_NAME: auto-upstream-merge
jobs:
build:
runs-on: ubuntu-latest
steps:
# Make sure you put workflow kit action on top of all the steps
- name: Collect Workflow Telemetry
uses: runforesight/foresight-workflow-kit-action@v1
with:
api_key: ${{ secrets.FORESIGHT_API_KEY }}
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ env.BRANCH_NAME }}
lfs: true
fetch-depth: 0
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'zulu'
- name: Install XMLStartLet
run: sudo apt install xmlstarlet
- name: Add jacoco plugin to POM
run: |
echo "$(xmlstarlet edit --omit-decl -N x="http://maven.apache.org/POM/4.0.0" \
-s '//x:build/x:plugins' -t elem -n 'plugin' \
-s '//x:build/x:plugins/plugin[last()]' -t elem -n 'groupId' -v 'org.jacoco' \
-s '//x:build/x:plugins/plugin[last()]' -t elem -n 'artifactId' -v 'jacoco-maven-plugin' \
-s '//x:build/x:plugins/plugin[last()]' -t elem -n 'version' -v '0.8.8' \
-s '//x:build/x:plugins/plugin[last()]' -t elem -n 'executions' \
-s '//x:build/x:plugins/plugin[last()]/executions' -t elem -n 'execution' \
-s '//x:build/x:plugins/plugin[last()]/executions/execution[last()]' -t elem -n 'goals'\
-s '//x:build/x:plugins/plugin[last()]/executions/execution[last()]/goals' -t elem -n 'goal' -v 'prepare-agent' \
-s '//x:build/x:plugins/plugin[last()]/executions' -t elem -n 'execution' \
-s '//x:build/x:plugins/plugin[last()]/executions/execution[last()]' -t elem -n 'id' -v 'report' \
-s '//x:build/x:plugins/plugin[last()]/executions/execution[last()]' -t elem -n 'phase' -v 'prepare-package' \
-s '//x:build/x:plugins/plugin[last()]/executions/execution[last()]' -t elem -n 'goals' \
-s '//x:build/x:plugins/plugin[last()]/executions/execution[last()]/goals' -t elem -n 'goal' -v 'report' \
pom.xml | xmlstarlet format --indent-tab)" > pom.xml.tmp && mv pom.xml.tmp pom.xml
- name: Run maven
run: mvn clean install -Pqulice
- name: Analyze Test and/or Coverage Results
if: always()
uses: runforesight/foresight-test-kit-action@v1
with:
api_key: ${{ secrets.FORESIGHT_API_KEY }}
test_framework: junit
test_path: "./*/target/surefire-reports/**"
coverage_format: jacoco/xml
coverage_path: "./*/target/site/jacoco/*.xml"