generated from hms-networks/sc-java-maven-starter-project
-
Notifications
You must be signed in to change notification settings - Fork 3
50 lines (43 loc) · 1.17 KB
/
junit-test.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
# HMS Networks Solution Center
# JUnit Test Action for Maven-based Ewon ETK Projects
# Version: 2.1
#
# This action is configured to automatically run when a push
# is made or pull request is merged to the `main` or `master`
# branch.
name: JUnit Test
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set Up JDK
uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: 16
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: |
~/.m2/repository
target/buildJdk
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Run JUnit Testing With Maven
run: mvn test -f pom.xml
- name: Upload Test Report(s)
uses: actions/upload-artifact@v3
with:
name: JUNIT-TEST-REPORTING-${{ github.sha }}-${{ github.event.repository.name }}
path: |
target/surefire-reports
target/site