Skip to content

Commit 3dbd156

Browse files
committed
Merge branch 'development'
2 parents 695572d + 387c4a0 commit 3dbd156

File tree

18 files changed

+432
-49
lines changed

18 files changed

+432
-49
lines changed

.github/workflows/ci.yml

Lines changed: 240 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,240 @@
1+
name: cbDebugger CI
2+
3+
# Only on Development we build snapshots
4+
on:
5+
push:
6+
branches:
7+
- development
8+
- master
9+
10+
env:
11+
MODULE_ID: cbdebugger
12+
13+
jobs:
14+
#############################################
15+
# Tests First baby! We fail, no build :(
16+
#############################################
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 coolblog;'
42+
# Import Database
43+
mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} < test-harness/tests/resources/coolblog.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+
uses: elpete/[email protected]
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: |
78+
box server start serverConfigFile="server-${{ matrix.cfengine }}.json" --noSaveSettings --debug
79+
# Install Adobe 2021 cfpm modules
80+
if [[ "${{ matrix.cfengine }}" == "adobe@2021" ]] ; then
81+
box run-script install:2021
82+
fi
83+
curl http://127.0.0.1:60299
84+
85+
- name: Run Tests
86+
working-directory: ./test-harness
87+
run: |
88+
mkdir tests/results
89+
box package set testbox.runner="http://localhost:60299/tests/runner.cfm"
90+
box testbox run --verbose outputFile=tests/results/test-results outputFormats=json,antjunit
91+
92+
- name: Publish Test Results
93+
uses: EnricoMi/publish-unit-test-result-action@v1
94+
if: always()
95+
with:
96+
files: test-harness/tests/results/**/*.xml
97+
check_name: "${{ matrix.cfengine }} Test Results"
98+
99+
- name: Upload Test Results Artifacts
100+
if: always()
101+
uses: actions/upload-artifact@v2
102+
with:
103+
name: test-results-${{ matrix.cfengine }}
104+
path: |
105+
test-harness/tests/results/**/*
106+
107+
- name: Slack Notification
108+
if: failure()
109+
uses: rtCamp/action-slack-notify@v2
110+
env:
111+
SLACK_CHANNEL: coding
112+
SLACK_COLOR: ${{ job.status }} # or a specific color like 'green' or '#ff00ff'
113+
SLACK_ICON_EMOJI: ":bell:"
114+
SLACK_MESSAGE: '${{ env.MODULE_ID }} tests failed :cry:'
115+
SLACK_TITLE: ${{ env.MODULE_ID }} Tests For ${{ matrix.cfengine }} failed
116+
SLACK_USERNAME: CI
117+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
118+
119+
- name: Failure Debugging Info
120+
if: ${{ failure() }}
121+
working-directory: ./test-harness
122+
run: |
123+
box server log serverConfigFile="server-${{ matrix.cfengine }}.json"
124+
125+
- name: Upload Debugging Info To Artifacts
126+
if: ${{ failure() }}
127+
uses: actions/upload-artifact@v2
128+
with:
129+
name: Failure Debugging Info - ${{ matrix.cfengine }}
130+
path: |
131+
test-harness/.engine/**/logs/*
132+
test-harness/.engine/**/WEB-INF/cfusion/logs/*
133+
134+
#############################################
135+
# Build Module
136+
#############################################
137+
build:
138+
name: Build & Publish
139+
needs: tests
140+
runs-on: ubuntu-20.04
141+
steps:
142+
- name: Checkout Repository
143+
uses: actions/checkout@v2
144+
with:
145+
fetch-depth: 0
146+
147+
- name: Setup Java
148+
uses: actions/setup-java@v2
149+
with:
150+
distribution: "adopt"
151+
java-version: "11"
152+
153+
- name: Setup nodejs
154+
uses: actions/setup-node@v2
155+
with:
156+
node-version: 12.x
157+
158+
- name: Cache CommandBox Dependencies
159+
uses: actions/cache@v1
160+
if: ${{ true }}
161+
with:
162+
path: ~/.CommandBox/artifacts
163+
key: ${{ runner.OS }}-commandbox-cache-${{ hashFiles( 'box.json' ) }}-${{ hashFiles( 'test-harness/box.json' ) }}
164+
restore-keys: |
165+
${{ runner.OS }}-commandbox-cache-${{ hashFiles( 'box.json' ) }}-${{ hashFiles( 'test-harness/box.json' ) }}
166+
167+
- name: Setup CommandBox
168+
uses: elpete/[email protected]
169+
with:
170+
forgeboxAPIKey: ${{ secrets.FORGEBOX_TOKEN }}
171+
172+
- name: Setup Environment Variables For Build Process
173+
id: current_version
174+
run: |
175+
echo "VERSION=`cat box.json | jq '.version' -r`" >> $GITHUB_ENV
176+
177+
# master or snapshot
178+
echo "Github Ref is $GITHUB_REF"
179+
echo "BRANCH=master" >> $GITHUB_ENV
180+
if [ $GITHUB_REF == 'refs/heads/development' ]
181+
then
182+
echo "BRANCH=development" >> $GITHUB_ENV
183+
fi
184+
185+
- name: Build ${{ env.MODULE_ID }}
186+
run: |
187+
npm i npm@latest -g
188+
npm install
189+
npm run prod
190+
rm -Rf node_modules
191+
box install commandbox-docbox
192+
box task run taskfile=build/Build target=run :version=${{ env.VERSION }} :projectName=${{ env.MODULE_ID }} :buildID=${{ github.run_number }} :branch=${{ env.BRANCH }}
193+
194+
- name: Upload Build Artifacts
195+
if: success()
196+
uses: actions/upload-artifact@v2
197+
with:
198+
name: ${{ env.MODULE_ID }}
199+
path: |
200+
.artifacts/**/*
201+
202+
- name: Upload Binaries to S3
203+
uses: jakejarvis/s3-sync-action@master
204+
with:
205+
args: --acl public-read
206+
env:
207+
AWS_S3_BUCKET: "downloads.ortussolutions.com"
208+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
209+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ACCESS_SECRET }}
210+
SOURCE_DIR: ".artifacts/${{ env.MODULE_ID }}"
211+
DEST_DIR: "ortussolutions/coldbox-modules/${{ env.MODULE_ID }}"
212+
213+
- name: Upload API Docs to S3
214+
uses: jakejarvis/s3-sync-action@master
215+
with:
216+
args: --acl public-read
217+
env:
218+
AWS_S3_BUCKET: "apidocs.ortussolutions.com"
219+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
220+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ACCESS_SECRET }}
221+
SOURCE_DIR: ".tmp/apidocs"
222+
DEST_DIR: "coldbox-modules/${{ env.MODULE_ID }}/${{ env.VERSION }}"
223+
224+
- name: Publish To ForgeBox
225+
run: |
226+
cd .tmp/${{ env.MODULE_ID }}
227+
cat box.json
228+
box forgebox publish
229+
230+
- name: Inform Slack
231+
if: ${{ always() }}
232+
uses: rtCamp/action-slack-notify@v2
233+
env:
234+
SLACK_CHANNEL: coding
235+
SLACK_COLOR: ${{ job.status }} # or a specific color like 'green' or '#ff00ff'
236+
SLACK_ICON_EMOJI: ":bell:"
237+
SLACK_MESSAGE: '${{ env.MODULE_ID }} Built with ${{ job.status }}!'
238+
SLACK_TITLE: "${{ env.MODULE_ID }} Build"
239+
SLACK_USERNAME: CI
240+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}

.github/workflows/pr.yml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: Pull Requests
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- "main"
7+
- "master"
8+
- "development"
9+
pull_request:
10+
branches:
11+
- development
12+
13+
jobs:
14+
tests:
15+
name: Tests
16+
runs-on: ubuntu-20.04
17+
env:
18+
DB_USER: root
19+
DB_PASSWORD: root
20+
strategy:
21+
fail-fast: true
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 Database and Fixtures
29+
run: |
30+
sudo /etc/init.d/mysql start
31+
mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} -e 'CREATE DATABASE coolblog;'
32+
mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} < test-harness/tests/resources/coolblog.sql
33+
34+
- name: Setup Java
35+
uses: actions/setup-java@v2
36+
with:
37+
distribution: "adopt"
38+
java-version: "11"
39+
40+
- name: Setup CommandBox
41+
uses: elpete/[email protected]
42+
43+
- name: Setup Environment For Testing Process
44+
working-directory: ./test-harness
45+
run: |
46+
# Setup .env
47+
touch .env
48+
# ENV
49+
printf "DB_HOST=localhost\n" >> .env
50+
printf "DB_USER=${{ env.DB_USER }}\n" >> .env
51+
printf "DB_PASSWORD=${{ env.DB_PASSWORD }}\n" >> .env
52+
printf "DB_CLASS=com.mysql.cj.jdbc.Driver\n" >> .env
53+
printf "DB_BUNDLEVERSION=8.0.19\n" >> .env
54+
printf "DB_BUNDLENAME=com.mysql.cj\n" >> .env
55+
56+
- name: Install Test Harness Dependencies
57+
working-directory: ./test-harness
58+
run: |
59+
box install
60+
61+
- name: Start ${{ matrix.cfengine }} Server
62+
working-directory: ./test-harness
63+
run: |
64+
box server start serverConfigFile="server-${{ matrix.cfengine }}.json" --noSaveSettings --debug
65+
curl http://127.0.0.1:60299
66+
67+
- name: Run Tests
68+
working-directory: ./test-harness
69+
run: |
70+
mkdir tests/results
71+
box package set testbox.runner="http://localhost:60299/tests/runner.cfm"
72+
box testbox run --verbose outputFile=tests/results/test-results outputFormats=json,antjunit
73+
74+
- name: Publish PR Test Reports
75+
uses: mikepenz/action-junit-report@v2
76+
with:
77+
report_paths: 'test-harness/tests/results/**/*.xml'
78+
check_name: "${{ matrix.cfengine }} Test Results"
79+
summary: true
80+
81+
- name: Failure Debugging Info
82+
if: ${{ failure() }}
83+
working-directory: ./test-harness
84+
run: |
85+
box server log serverConfigFile="server-${{ matrix.cfengine }}.json"
86+
87+
format:
88+
name: Format
89+
runs-on: ubuntu-20.04
90+
steps:
91+
- name: Checkout Repository
92+
uses: actions/checkout@v2
93+
94+
- name: Setup Java
95+
uses: actions/setup-java@v2
96+
with:
97+
distribution: "adopt"
98+
java-version: "11"
99+
100+
- name: Set Up CommandBox
101+
uses: elpete/[email protected]
102+
103+
- name: Install CFFormat
104+
run: box install commandbox-cfformat
105+
106+
- name: Run CFFormat
107+
run: box run-script format
108+
109+
- name: Commit Format Changes
110+
uses: stefanzweifel/git-auto-commit-action@v4
111+
with:
112+
commit_message: Apply cfformat changes

ModuleConfig.cfc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,7 @@ component {
114114
logParams : true
115115
},
116116
// Async Manager Reporting
117-
async : {
118-
enabled : true,
119-
expanded : false
120-
}
117+
async : { enabled : true, expanded : false }
121118
};
122119

123120
// Visualizer Route

box.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name":"ColdBox Debugger",
33
"author":"Ortus Solutions <[email protected]",
44
"location":"https://downloads.ortussolutions.com/ortussolutions/coldbox-modules/cbdebugger/@build.version@/[email protected]@.zip",
5-
"version":"3.1.1",
5+
"version":"3.2.0",
66
"slug":"cbdebugger",
77
"type":"modules",
88
"homepage":"https://github.com/coldbox-modules/cbdebugger",
File renamed without changes.

0 commit comments

Comments
 (0)