-
Notifications
You must be signed in to change notification settings - Fork 18
53 lines (47 loc) · 1.53 KB
/
coverage-report-pull-request.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Code coverage Builder
# To deal with https://securitylab.github.com/research/github-actions-preventing-pwn-requests
# we need to split this across two jobs. The part that writes to the pull request lives in
# ./coverage-report-workflow.yaml
on:
pull_request:
jobs:
build:
permissions:
contents: read
name: Run code coverage analysis and reporting
runs-on: ubuntu-latest
env:
ARTIFACTS: .pr_artifacts
steps:
- name: Prepare
id: prepare
run: |
# Make ARTIFACTS absolute
ARTIFACTS="${GITHUB_WORKSPACE}/${ARTIFACTS}"
echo "ARTIFACTS=${ARTIFACTS}" >> $GITHUB_ENV
mkdir ${ARTIFACTS}
echo ${{ github.event.number }} > "${ARTIFACTS}/pr"
echo "base=${GITHUB_BASE_REF}" >> $GITHUB_OUTPUT
echo "artifacts=${ARTIFACTS}" >> $GITHUB_OUTPUT
- uses: actions/checkout@v4
name: Checkout from Git
with:
fetch-depth: 0
- uses: actions/setup-java@v4
name: Setup Java
with:
distribution: temurin
java-version: 11
cache: maven
- name: Run tests with coverage
run: ./mvnw verify -Pcoverage
- name: Run tests with coverage
run: |
mkdir -p ${ARTIFACTS}/build
cp -Rf ./runtime ${ARTIFACTS}/build/.
cp -Rf ./api ${ARTIFACTS}/build/.
cp -Rf *.* ${ARTIFACTS}/build/.
- uses: actions/upload-artifact@v4
with:
name: input-artifacts
path: ${{ steps.prepare.outputs.artifacts }}