-
-
Notifications
You must be signed in to change notification settings - Fork 14
113 lines (100 loc) · 3.37 KB
/
tests.yml
File metadata and controls
113 lines (100 loc) · 3.37 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
name: Test Suites
on:
workflow_call:
jobs:
tests:
name: Tests
runs-on: ubuntu-latest
env:
DB_USER: root
DB_PASSWORD: root
WEB_PORT: 60299
strategy:
fail-fast: false
matrix:
include:
- cfengine: "boxlang"
jdkVersion: "21"
engineModules: "bx-compat-cfml,bx-esapi"
- cfengine: "lucee@5"
jdkVersion: "11"
engineModules:
- cfengine: "lucee@6"
jdkVersion: "21"
engineModules:
- cfengine: "adobe@2023"
jdkVersion: "21"
engineModules:
- cfengine: "adobe@2025"
jdkVersion: "21"
engineModules:
steps:
- name: Checkout Repository
uses: actions/checkout@v4
# Not Needed in this module
- name: Setup Database and Fixtures
run: |
sudo systemctl start mysql.service
mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} -e 'CREATE DATABASE coldbox;'
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: ${{ matrix.jdkVersion }}
- name: Setup CommandBox CLI
uses: Ortus-Solutions/setup-commandbox@v2.0.1
- name: Setup Environment For Testing Process
run: |
# Setup .env
touch .env
# ENV
printf "DB_HOST=localhost\n" >> .env
printf "DB_DATABASE=coldbox\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
- name: Start ${{ matrix.cfengine }} Server
run: |
box server set web.http.port=${{ env.WEB_PORT }}
box server set app.cfengine=${{ matrix.cfengine }}
if [ -n "${{ matrix.engineModules }}" ]; then
echo "Installing Engine Modules: ${{ matrix.engineModules }}"
box server set scripts.onServerInitialInstall="install ${{ matrix.engineModules }}"
fi
box server start --debug
curl http://127.0.0.1:${{ env.WEB_PORT }}
- name: Run Tests
run: |
mkdir -p tests/results
box testbox run --verbose outputFile=tests/results/test-results outputFormats=json,antjunit
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
junit_files: tests/results/**/*.xml
check_name: "${{ matrix.cfengine }} Test Results"
- name: Upload Test Results to Artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.cfengine }}
path: |
tests/results/**/*
- name: Show Server Log On Failures
if: ${{ failure() }}
run: |
box server log
- name: Upload Debug Logs To Artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: Failure Debugging Info - ${{ matrix.cfengine }}
path: |
.engine/**/logs/*
.engine/**/WEB-INF/cfusion/logs/*