-
Notifications
You must be signed in to change notification settings - Fork 26
47 lines (38 loc) · 1.33 KB
/
tests.yml
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
name: Tests
on: [ push, pull_request_target ]
permissions:
contents: read
pull-requests: write
jobs:
test:
name: Tests
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 8
- name: Maven Package
run: mvn clean install -Dgpg.skip -Dmaven.javadoc.skip -Dmaven.test.skip
- name: Tests with Coverage
run: mvn clean test jacoco:report
- name: Set branch name and PR number
id: refs
env:
BRANCH_NAME_OR_REF: ${{ github.head_ref || github.ref }}
run: |
echo "::set-output name=branch_name::${BRANCH_NAME_OR_REF#refs/heads/}"
echo "::set-output name=pr_number::$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")"
- name: Report to Coveralls
env:
CI_NAME: Github
CI_BUILD_NUMBER: ${{ github.run_id }}
CI_BUILD_URL: https://github.com/${{ github.repository }}/commit/${{ github.event.after }}/checks
CI_BRANCH: ${{ steps.refs.outputs.branch_name }}
CI_PULL_REQUEST: ${{ steps.refs.outputs.pr_number }}
run: |
mvn coveralls:report \
--no-transfer-progress \
-D repoToken=${{ secrets.COVERALLS_TOKEN }}