-
-
Notifications
You must be signed in to change notification settings - Fork 172
145 lines (129 loc) · 4.86 KB
/
tests.yml
File metadata and controls
145 lines (129 loc) · 4.86 KB
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# This is a reusable workflow for executing the full ColdBox Test Suites
name: ColdBox Test Suites
# We are a reusable Workflow only
on:
workflow_call:
secrets:
SLACK_WEBHOOK_URL:
required: false
# Allow manual triggering
workflow_dispatch:
jobs:
tests:
name: Test Suites
runs-on: ubuntu-24.04
timeout-minutes: ${{ matrix.timeoutMinutes }}
env:
DB_USER: root
DB_PASSWORD: root
COMMANDBOX_VERSION: 6.2.1
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
cfengine: [ "boxlang@1", "boxlang-cfml@1", "lucee@5", "lucee@6", "adobe@2025" ]
jdkVersion: [ "21" ]
experimental: [ false ]
timeoutMinutes: [ 8 ]
include:
- cfengine: "boxlang-cfml@be"
jdkVersion: "21"
experimental: true
timeoutMinutes: 8
# Added here, due to cfpm crapping out too often, and I can't build
- cfengine: "adobe@2023"
jdkVersion: "11"
experimental: true
timeoutMinutes: 8
steps:
- name: Checkout Repository
uses: actions/checkout@v6
- name: Setup Database and Fixtures
run: |
sudo systemctl start mysql.service
mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} -e 'CREATE DATABASE coolblog;'
mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} < tests/resources/coolblog.sql
- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: "temurin"
java-version: ${{ matrix.jdkVersion }}
- name: Setup CommandBox CLI
uses: Ortus-Solutions/setup-commandbox@v2.0.1
with:
version: ${{ env.COMMANDBOX_VERSION }}
install: commandbox-boxlang
- name: Setup .env For Runner
run: |
touch .env
printf "DB_HOST=127.0.0.1\n" >> .env
printf "DB_DATABASE=coolblog\n" >> .env
printf "DB_DRIVER=MySQL\n" >> .env
printf "DB_USER=${{ env.DB_USER }}\n" >> .env
printf "DB_PASSWORD=${{ env.DB_PASSWORD }}\n" >> .env
printf "DB_CLASS=com.mysql.cj.jdbc.Driver\n" >> .env
printf "DB_BUNDLEVERSION=8.0.19\n" >> .env
printf "DB_BUNDLENAME=com.mysql.cj\n" >> .env
- name: Install Dependencies
run: |
box install --verbose
- name: Start ${{ matrix.cfengine }} Server
run: |
box server start serverConfigFile="server-${{ matrix.cfengine }}.json" --noSaveSettings --debug
curl http://127.0.0.1:8599/test-harness
- name: Run Tests
run: |
box run-script tests
- name: Set cfengine version env
run: echo "CFENGINE_VERSION=$(box echo ${serverInfo.engineName@coldbox-${{ matrix.cfengine }}}@${serverInfo.engineVersion@coldbox-${{ matrix.cfengine }}})" >> $GITHUB_ENV
- name: Publish Test Reports
uses: mikepenz/action-junit-report@v6.4.0
if: always()
with:
report_paths: |
tests/results/**/*.xml
check_name: "TestBox Report ${{ matrix.cfengine }}-${{ matrix.jdkVersion }}"
include_passed: false
fail_on_failure: true
detailed_summary: true
- name: Slack Notification
# Only on failures and NOT in pull requests
if: ${{ failure() && !startsWith( 'pull_request', github.event_name ) }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_CHANNEL: coding
SLACK_COLOR: ${{ job.status }} # or a specific color like 'green' or '#ff00ff'
SLACK_ICON_EMOJI: ":bell:"
SLACK_MESSAGE: 'ColdBox tests failed :cry:, check them out here: https://github.com/coldbox/coldbox-platform/actions'
SLACK_TITLE: ColdBox Tests For ${{ matrix.cfengine }} failed
SLACK_USERNAME: CI
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
- name: Output Failure Debugging Info
if: ${{ failure() }}
run: |
box version
box server info serverConfigFile="server-${{ matrix.cfengine }}.json" --json
box server log serverConfigFile="server-${{ matrix.cfengine }}.json"
- name: Upload Debugging Info To Artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@v7
with:
name: Failure Debugging Info - ${{ matrix.cfengine }} - ${{ matrix.jdkVersion }}
path: |
.engine/**/logs/*
.engine/**/WEB-INF/cfusion/logs/*
# Publish the test results
publish-test-results:
name: Publish Test Results
needs: tests
runs-on: ubuntu-latest
if: always()
steps:
- name: Download Test Results Artifacts
uses: actions/download-artifact@v8
with:
path: artifacts
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: artifacts/**/*.xml