-
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (75 loc) · 2.28 KB
/
short_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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Action to automatically run unit tests on the project
# and publish the results as a comment on the PR
# main action used to make this work are:
# - eskatos/gradle-command-action@v1
# - EnricoMi/publish-unit-test-result-action@v1
name: Short CI (Unit Tests only)
on:
# run on pull request to main (release) & develop (feature merge)
pull_request:
branches:
- main
- develop
# and manual run
workflow_dispatch:
jobs:
# run unit tests
unit_test:
name: Unit Tests
runs-on: ubuntu-latest
timeout-minutes: 10
env:
JAVA_TOOL_OPTIONS: -Xmx5g -XX:+UseParallelGC
steps:
# setup env
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: 11
- run: |
mkdir -p ~/.gradle
cp .github/gh-gradle.properties ~/.gradle/gradle.properties
chmod +x ./gradlew
# run gradle unit test task
- name: Run unit tests
uses: eskatos/gradle-command-action@v1
with:
arguments: testDebugUnitTest
wrapper-cache-enabled: true
dependencies-cache-enabled: true
configuration-cache-enabled: true
# print contents of artifact dir
- run: ls ./app/build/test-results/testDebugUnitTest
# upload results
- name: Upload Test Results
uses: actions/upload-artifact@v4
with:
name: unit-test-results
path: ./app/build/test-results/testDebugUnitTest/*.xml
# publish test results (even if tests failed)
publish_results:
name: Publish Test Results
needs: unit_test
if: always()
runs-on: ubuntu-latest
steps:
# download unit test results
- run: mkdir ./results/
- name: Download Unit Test Results
uses: actions/download-artifact@v4
with:
name: unit-test-results
path: ./results/
# print contents of artifact dir
- run: ls ./results
# publish results
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@v1
if: always()
with:
check_name: Test Results (Unit Tests Only)
report_individual_runs: true
github_token: ${{ secrets.GITHUB_TOKEN }}
files: |
./results/*.xml