-
-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (99 loc) · 3.12 KB
/
tests.yml
File metadata and controls
112 lines (99 loc) · 3.12 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
name: Test Suites
on:
workflow_call:
jobs:
tests:
name: Tests
runs-on: ubuntu-latest
env:
DB_USER: root
DB_PASSWORD: root
WEB_PORT: 60299
JDK_VERSION: "21"
strategy:
fail-fast: false
matrix:
include:
- cfengine: "boxlang@1"
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
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: ${{ env.JDK_VERSION }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
- name: Setup CommandBox CLI
uses: Ortus-Solutions/setup-commandbox@v2.0.1
with:
install: testbox-cli,commandbox-boxlang
- 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.33\n" >> .env
printf "DB_BUNDLENAME=com.mysql.cj\n" >> .env
- name: Install & Build Dependencies
run: |
npm install --no-audit --no-fund --prefer-offline
npm run build
box install
- name: Start ${{ matrix.cfengine }} Server
run: |
box server set web.http.port=${{ env.WEB_PORT }}
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: ${{ always() }}
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/*