@@ -11,104 +11,13 @@ env:
11
11
MODULE_ID : cbvalidation
12
12
13
13
jobs :
14
- # ############################################
14
+ # ############################################
15
15
# Tests First baby! We fail, no build :(
16
16
# ############################################
17
17
tests :
18
- name : Tests
19
- runs-on : ubuntu-20.04
20
- strategy :
21
- fail-fast : false
22
- matrix :
23
- cfengine : [ "lucee@5", "adobe@2016", "adobe@2018", "adobe@2021" ]
24
- steps :
25
- - name : Checkout Repository
26
- uses : actions/checkout@v2
27
-
28
- - name : Setup Java
29
- uses : actions/setup-java@v2
30
- with :
31
- distribution : " adopt"
32
- java-version : " 11"
33
-
34
- - name : Cache CommandBox Dependencies
35
- uses : actions/cache@v1
36
- if : ${{ true }}
37
- with :
38
- path : ~/.CommandBox/artifacts
39
- key : ${{ runner.OS }}-commandbox-cache-${{ hashFiles( 'box.json' ) }}-${{ hashFiles( 'test-harness/box.json' ) }}
40
- restore-keys : |
41
- ${{ runner.OS }}-commandbox-cache-${{ hashFiles( 'box.json' ) }}-${{ hashFiles( 'test-harness/box.json' ) }}
42
-
43
- - name : Setup CommandBox
44
-
45
-
46
- - name : Install Test Harness Dependencies
47
- working-directory : ./test-harness
48
- run : |
49
- box install
50
-
51
- - name : Start ${{ matrix.cfengine }} Server
52
- working-directory : ./test-harness
53
- run : box server start serverConfigFile="server-${{ matrix.cfengine }}.json" --noSaveSettings --debug
54
-
55
- - name : CFPM Setup
56
- if : ${{ matrix.cfengine == 'adobe@2021' }}
57
- working-directory : ./test-harness
58
- run : box run-script install:2021
59
-
60
- - name : Prime ${{ matrix.cfengine }} server
61
- working-directory : ./test-harness
62
- run : curl http://127.0.0.1:60299
63
-
64
- - name : Run Tests
65
- working-directory : ./test-harness
66
- run : |
67
- mkdir tests/results
68
- box package set testbox.runner="http://localhost:60299/tests/runner.cfm"
69
- box testbox run --verbose outputFile=tests/results/test-results outputFormats=json,antjunit
70
-
71
- - name : Publish Test Results
72
- uses : EnricoMi/publish-unit-test-result-action@v1
73
- if : always()
74
- with :
75
- files : test-harness/tests/results/**/*.xml
76
- check_name : " ${{ matrix.cfengine }} Test Results"
77
-
78
- - name : Upload Test Results Artifacts
79
- if : always()
80
- uses : actions/upload-artifact@v2
81
- with :
82
- name : test-results-${{ matrix.cfengine }}
83
- path : |
84
- test-harness/tests/results/**/*
85
-
86
- - name : Slack Notification
87
- if : failure()
88
- uses : rtCamp/action-slack-notify@v2
89
- env :
90
- SLACK_CHANNEL : coding
91
- SLACK_COLOR : ${{ job.status }} # or a specific color like 'green' or '#ff00ff'
92
- SLACK_ICON_EMOJI : " :bell:"
93
- SLACK_MESSAGE : ' ${{ env.MODULE_ID }} tests failed :cry:'
94
- SLACK_TITLE : ${{ env.MODULE_ID }} Tests For ${{ matrix.cfengine }} failed
95
- SLACK_USERNAME : CI
96
- SLACK_WEBHOOK : ${{ secrets.SLACK_WEBHOOK_URL }}
97
-
98
- - name : Failure Debugging Info
99
- if : ${{ failure() }}
100
- working-directory : ./test-harness
101
- run : |
102
- box server log serverConfigFile="server-${{ matrix.cfengine }}.json"
103
-
104
- - name : Upload Debugging Info To Artifacts
105
- if : ${{ failure() }}
106
- uses : actions/upload-artifact@v2
107
- with :
108
- name : Failure Debugging Info - ${{ matrix.cfengine }}
109
- path : |
110
- test-harness/.engine/**/logs/*
111
- test-harness/.engine/**/WEB-INF/cfusion/logs/*
18
+ uses : ./.github/workflows/tests.yml
19
+ secrets :
20
+ SLACK_WEBHOOK_URL : ${{ secrets.SLACK_WEBHOOK_URL }}
112
21
113
22
# ############################################
114
23
# Build Module
@@ -129,17 +38,8 @@ jobs:
129
38
distribution : " adopt"
130
39
java-version : " 11"
131
40
132
- - name : Cache CommandBox Dependencies
133
- uses : actions/cache@v1
134
- if : ${{ true }}
135
- with :
136
- path : ~/.CommandBox/artifacts
137
- key : ${{ runner.OS }}-commandbox-cache-${{ hashFiles( 'box.json' ) }}-${{ hashFiles( 'test-harness/box.json' ) }}
138
- restore-keys : |
139
- ${{ runner.OS }}-commandbox-cache-${{ hashFiles( 'box.json' ) }}-${{ hashFiles( 'test-harness/box.json' ) }}
140
-
141
41
- name : Setup CommandBox
142
- uses : elpete /setup-commandbox@v1.0.0
42
+ uses : Ortus-Solutions /setup-commandbox@main
143
43
with :
144
44
forgeboxAPIKey : ${{ secrets.FORGEBOX_TOKEN }}
145
45
0 commit comments