-
Notifications
You must be signed in to change notification settings - Fork 5
47 lines (38 loc) · 1.23 KB
/
maven-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
name: "Maven Test"
on:
push:
branches:
- develop
- master
jobs:
maven-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Setup environment"
shell: bash
run: |
echo "COMMIT_SHA_ABREV=$(echo $GITHUB_SHA | cut -c1-7)" >> $GITHUB_ENV
echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
echo "RUN_DATE=$(date +'%d-%m-%Y')" >> $GITHUB_ENV
echo "COMMIT_SHA_ABREV: ${COMMIT_SHA_ABREV}"
echo "BRANCH_NAME: ${BRANCH_NAME}"
echo "RUN_DATE: ${RUN_DATE}"
- name: "Setup JDK 17"
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
architecture: x64
cache: maven
- name: "Run Maven 'test'"
run: mvn test -e -P fancy-report --color always
- name: "Upload test report"
uses: actions/upload-artifact@v4
if: failure()
with:
name: test-report-${{ env.COMMIT_SHA_ABREV }}-${{ env.RUN_DATE }}
path: target/surefire-reports/
- name: "Publish Test Report"
if: success() || failure()
uses: scacap/action-surefire-report@v1