@@ -15,124 +15,9 @@ jobs:
15
15
# Tests First baby! We fail, no build :(
16
16
# ############################################
17
17
tests :
18
- name : Tests
19
- runs-on : ubuntu-20.04
20
- env :
21
- DB_USER : root
22
- DB_PASSWORD : root
23
- strategy :
24
- fail-fast : false
25
- matrix :
26
- cfengine : [ "lucee@5", "adobe@2016", "adobe@2018", "adobe@2021" ]
27
- steps :
28
- - name : Checkout Repository
29
- uses : actions/checkout@v2
30
-
31
- - name : Setup Java
32
- uses : actions/setup-java@v2
33
- with :
34
- distribution : " adopt"
35
- java-version : " 11"
36
-
37
- - name : Setup Database and Fixtures
38
- run : |
39
- sudo /etc/init.d/mysql start
40
- # Create Database
41
- mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} -e 'CREATE DATABASE cbsecurity;'
42
- # Import Database
43
- mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} < test-harness/tests/resources/cbsecurity.sql
44
-
45
- - name : Setup Environment For Testing Process
46
- working-directory : ./test-harness
47
- run : |
48
- # Setup .env
49
- touch .env
50
- # ENV
51
- printf "DB_HOST=localhost\n" >> .env
52
- printf "DB_USER=${{ env.DB_USER }}\n" >> .env
53
- printf "DB_PASSWORD=${{ env.DB_PASSWORD }}\n" >> .env
54
- printf "DB_CLASS=com.mysql.cj.jdbc.Driver\n" >> .env
55
- printf "DB_BUNDLEVERSION=8.0.19\n" >> .env
56
- printf "DB_BUNDLENAME=com.mysql.cj\n" >> .env
57
-
58
- - name : Cache CommandBox Dependencies
59
- uses : actions/cache@v1
60
- if : ${{ true }}
61
- with :
62
- path : ~/.CommandBox/artifacts
63
- key : ${{ runner.OS }}-commandbox-cache-${{ hashFiles( 'box.json' ) }}-${{ hashFiles( 'test-harness/box.json' ) }}
64
- restore-keys : |
65
- ${{ runner.OS }}-commandbox-cache-${{ hashFiles( 'box.json' ) }}-${{ hashFiles( 'test-harness/box.json' ) }}
66
-
67
- - name : Setup CommandBox
68
-
69
-
70
- - name : Install Test Harness Dependencies
71
- working-directory : ./test-harness
72
- run : |
73
- box install
74
-
75
- - name : Start ${{ matrix.cfengine }} Server
76
- working-directory : ./test-harness
77
- run : box server start serverConfigFile="server-${{ matrix.cfengine }}.json" --noSaveSettings --debug
78
-
79
- - name : CFPM Setup
80
- if : ${{ matrix.cfengine == 'adobe@2021' }}
81
- working-directory : ./test-harness
82
- run : box run-script install:2021
83
-
84
- - name : Prime ${{ matrix.cfengine }} server
85
- working-directory : ./test-harness
86
- run : curl http://127.0.0.1:60299
87
-
88
- - name : Run Tests
89
- working-directory : ./test-harness
90
- run : |
91
- mkdir tests/results
92
- box package set testbox.runner="http://localhost:60299/tests/runner.cfm"
93
- box testbox run --verbose outputFile=tests/results/test-results outputFormats=json,antjunit
94
-
95
- - name : Publish Test Results
96
- uses : EnricoMi/publish-unit-test-result-action@v1
97
- if : always()
98
- with :
99
- files : test-harness/tests/results/**/*.xml
100
- check_name : " ${{ matrix.cfengine }} Test Results"
101
-
102
- - name : Upload Test Results Artifacts
103
- if : always()
104
- uses : actions/upload-artifact@v2
105
- with :
106
- name : test-results-${{ matrix.cfengine }}
107
- path : |
108
- test-harness/tests/results/**/*
109
-
110
- - name : Slack Notification
111
- if : failure()
112
- uses : rtCamp/action-slack-notify@v2
113
- env :
114
- SLACK_CHANNEL : coding
115
- SLACK_COLOR : ${{ job.status }} # or a specific color like 'green' or '#ff00ff'
116
- SLACK_ICON_EMOJI : " :bell:"
117
- SLACK_MESSAGE : ' ${{ env.MODULE_ID }} tests failed :cry:'
118
- SLACK_TITLE : ${{ env.MODULE_ID }} Tests For ${{ matrix.cfengine }} failed
119
- SLACK_USERNAME : CI
120
- SLACK_WEBHOOK : ${{ secrets.SLACK_WEBHOOK_URL }}
121
-
122
- - name : Failure Debugging Info
123
- if : ${{ failure() }}
124
- working-directory : ./test-harness
125
- run : |
126
- box server log serverConfigFile="server-${{ matrix.cfengine }}.json"
127
-
128
- - name : Upload Debugging Info To Artifacts
129
- if : ${{ failure() }}
130
- uses : actions/upload-artifact@v2
131
- with :
132
- name : Failure Debugging Info - ${{ matrix.cfengine }}
133
- path : |
134
- test-harness/.engine/**/logs/*
135
- test-harness/.engine/**/WEB-INF/cfusion/logs/*
18
+ uses : ./.github/workflows/tests.yml
19
+ secrets :
20
+ SLACK_WEBHOOK_URL : ${{ secrets.SLACK_WEBHOOK_URL }}
136
21
137
22
# ############################################
138
23
# Build Module
@@ -143,27 +28,18 @@ jobs:
143
28
runs-on : ubuntu-20.04
144
29
steps :
145
30
- name : Checkout Repository
146
- uses : actions/checkout@v2
31
+ uses : actions/checkout@v3.2.0
147
32
with :
148
33
fetch-depth : 0
149
34
150
35
- name : Setup Java
151
- uses : actions/setup-java@v2
36
+ uses : actions/setup-java@v3.9.0v2
152
37
with :
153
- distribution : " adopt "
38
+ distribution : " temurin "
154
39
java-version : " 11"
155
40
156
- - name : Cache CommandBox Dependencies
157
- uses : actions/cache@v1
158
- if : ${{ true }}
159
- with :
160
- path : ~/.CommandBox/artifacts
161
- key : ${{ runner.OS }}-commandbox-cache-${{ hashFiles( 'box.json' ) }}-${{ hashFiles( 'test-harness/box.json' ) }}
162
- restore-keys : |
163
- ${{ runner.OS }}-commandbox-cache-${{ hashFiles( 'box.json' ) }}-${{ hashFiles( 'test-harness/box.json' ) }}
164
-
165
41
- name : Setup CommandBox
166
- uses : elpete /setup-commandbox@v1 .0.0
42
+ uses : Ortus-Solutions /setup-commandbox@v2 .0.1
167
43
with :
168
44
forgeboxAPIKey : ${{ secrets.FORGEBOX_TOKEN }}
169
45
187
63
188
64
- name : Upload Build Artifacts
189
65
if : success()
190
- uses : actions/upload-artifact@v2
66
+ uses : actions/upload-artifact@v3.1.1
191
67
with :
192
68
name : ${{ env.MODULE_ID }}
193
69
path : |
0 commit comments