-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (66 loc) · 2.22 KB
/
run-tests.yaml
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
name: Run Tests
on:
push:
branches: [ "main" ]
paths-ignore: [ "**.md", "**.txt" ]
pull_request:
branches: [ "main" ]
paths-ignore: [ "**.md", "**.txt" ]
workflow_dispatch:
jobs:
build-test:
name: "Run Tests"
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
check-latest: true
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
cache-dependency-path: 'strcalc/src/main/frontend/pnpm-lock.yaml'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Install Node packages
run: ./gradlew --warning-mode=fail pnpmInstall
- name: Build and test
run: ./gradlew --warning-mode=fail build
- name: Merge test reports
run: ./gradlew --warning-mode=fail merge-test-reports
if: always()
- name: Generate coverage report
run: ./gradlew --warning-mode=fail jacocoXmlTestReport
if: always()
# Per the advice from:
# - https://github.com/marketplace/actions/test-reporter
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: '**/build/test-results/test*/TESTS-TestSuites.xml'
- name: Send Java backend test coverage to Coveralls.io
uses: coverallsapp/github-action@v2
if: always()
with:
# The .xml file only contains paths relative to this one.
base-path: 'strcalc/src/main/java'
file: 'strcalc/build/reports/jacoco/jacocoXmlTestReport/jacocoXmlTestReport.xml'
- name: Send JavaScript frontend test coverage to Coveralls.io
uses: coverallsapp/github-action@v2
if: always()
with:
# The lcov file only contains paths relative to this one.
base-path: 'strcalc/src/main/frontend'
file: 'strcalc/build/reports/frontend/coverage/lcov.info'