-
Notifications
You must be signed in to change notification settings - Fork 42
94 lines (79 loc) · 2.72 KB
/
pull_request.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
84
85
86
87
88
89
90
91
92
93
94
name: Build the app
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
concurrency:
# Only run once for latest commit per ref and cancel other (previous) runs.
group: ci-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read # for checkout
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: Setup Scala
uses: japgolly/[email protected]
with:
java-version: 'adopt:1.11.0-11'
node-version: '16.7.0'
- name: Cache compiled code
uses: actions/cache@v3
with:
path: |
**/target/
/home/runner/.ivy2/local
key: compiled-code-cache-${{ hashFiles('**/build.sbt') }}
restore-keys: compiled-code-cache-
- name: Run test admin controller
run: CI=true sbt "testOnly controllers.AdminControllerSpec"
- name: Test Summary
uses: test-summary/action@v2
with:
paths: "server/target/test-reports/*.xml"
output: test-summary.md
if: always()
# - name: Print test results
# if: failure()
# run: |
# sudo apt-get update && sudo apt-get install -y libxml2-utils &&
# # Find all XML files in the server/target/test-reports directory
# for file in server/target/test-reports/*.xml; do
# if [ -f "$file" ]; then
# # check if file has <failure> tags
# # dont print boolean
# if xmllint --xpath 'boolean(//testsuite/testcase/failure)' "$file"; then
# echo "Processing $file:"
# # Extract and print <failure> tags inside <testcase> tags
# xmllint --xpath '//testsuite/testcase/failure/text()' "$file"
# echo
# fi
# # echo "Processing $file:"
#
# # Extract and print <failure> tags inside <testcase> tags
# # xmllint --xpath '//testsuite/testcase/failure/text()' "$file"
# # if there are <failure> tags, print <testcase> classname and name attributes
# # xmllint --xpath '//testsuite/testcase/failure/parent::testcase/@classname | //testsuite/testcase/failure/parent::testcase/@name' "$file"
#
# echo
# else
# echo "No XML files found."
# fi
# done
# TODO uncomment when tests are added
# - name: Check code format
# run: sbt scalafmtCheckAll
# - name: Compile
# run: CI=true sbt compile
# - name: Run tests
# run: CI=true sbt test
#
# - name: Prepare web build
# run: sbt web/build
#
# - name: Prepare server build
# run: sbt server/dist