-
Notifications
You must be signed in to change notification settings - Fork 6
60 lines (48 loc) · 1.63 KB
/
ci.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
48
49
50
51
52
53
54
55
56
57
58
59
60
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Java CI with Maven
on:
push:
branches:
- master
- v2
- v2.2
pull_request:
branches:
- master
- v2
- v2.2
jobs:
run-unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Create multimedia dir
run: sudo mkdir -p /opt/multimedia/patient_images && id
- name: Grant read and write permissions to multimedia directory
run: sudo chmod a+rwx /opt/multimedia/patient_images
- name: Run Unit tests with Maven
run: mvn -B clean test jacoco:report --file pom.xml --no-transfer-progress
- name: Set Branch name Environment variable
env:
BRANCH_NAME_OR_REF: ${{ github.head_ref || github.ref }}
run: echo "BRANCH_NAME=${BRANCH_NAME_OR_REF#refs/heads/}" >> $GITHUB_ENV
- name: Set PR Number Environment variable
run: |
echo "PR_NUMBER=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")" >> $GITHUB_ENV
- name: Upload coveralls report
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
run: |
mvn -B coveralls:report --file pom.xml \
--no-transfer-progress \
-D repoToken="$COVERALLS_REPO_TOKEN" \
-D serviceName=Github \
-D branch="$BRANCH_NAME" \
-D pullRequest="$PR_NUMBER" \