Skip to content

Commit 3992a84

Browse files
committed
Merge branch 'development'
2 parents 16cd8b2 + 1c33dc9 commit 3992a84

File tree

23 files changed

+1370
-601
lines changed

23 files changed

+1370
-601
lines changed

.cfformat.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"array.empty_padding": false,
33
"array.padding": true,
4-
"array.multiline.min_length": 40,
4+
"array.multiline.min_length": 50,
55
"array.multiline.element_count": 2,
66
"array.multiline.leading_comma.padding": true,
77
"array.multiline.leading_comma": false,
88
"alignment.consecutive.assignments": true,
9-
"alignment.consecutive.properties": true,
9+
"alignment.consecutive.properties": false,
1010
"alignment.consecutive.params": true,
1111
"brackets.padding": true,
1212
"comment.asterisks": "align",
@@ -17,22 +17,22 @@
1717
"function_call.multiline.leading_comma.padding": true,
1818
"function_call.casing.builtin": "cfdocs",
1919
"function_call.casing.userdefined": "camel",
20-
"function_call.multiline.element_count": 2,
20+
"function_call.multiline.element_count": 3,
2121
"function_call.multiline.leading_comma": false,
22-
"function_call.multiline.min_length": 40,
22+
"function_call.multiline.min_length": 50,
2323
"function_declaration.padding": true,
2424
"function_declaration.empty_padding": false,
2525
"function_declaration.multiline.leading_comma": false,
2626
"function_declaration.multiline.leading_comma.padding": true,
27-
"function_declaration.multiline.element_count": 2,
28-
"function_declaration.multiline.min_length": 40,
27+
"function_declaration.multiline.element_count": 3,
28+
"function_declaration.multiline.min_length": 50,
2929
"function_declaration.group_to_block_spacing": "compact",
3030
"function_anonymous.empty_padding": false,
3131
"function_anonymous.group_to_block_spacing": "compact",
32-
"function_anonymous.multiline.element_count": 2,
32+
"function_anonymous.multiline.element_count": 3,
3333
"function_anonymous.multiline.leading_comma": false,
3434
"function_anonymous.multiline.leading_comma.padding": true,
35-
"function_anonymous.multiline.min_length": 40,
35+
"function_anonymous.multiline.min_length": 50,
3636
"function_anonymous.padding": true,
3737
"indent_size": 4,
3838
"keywords.block_to_keyword_spacing": "spaced",
@@ -41,13 +41,13 @@
4141
"keywords.spacing_to_block": "spaced",
4242
"keywords.spacing_to_group": true,
4343
"keywords.empty_group_spacing": false,
44-
"max_columns": 120,
44+
"max_columns": 100,
4545
"metadata.multiline.element_count": 3,
46-
"metadata.multiline.min_length": 40,
46+
"metadata.multiline.min_length": 50,
4747
"method_call.chain.multiline" : 3,
4848
"newline":"\n",
4949
"property.multiline.element_count": 3,
50-
"property.multiline.min_length": 40,
50+
"property.multiline.min_length": 30,
5151
"parentheses.padding": true,
5252
"strings.quote": "double",
5353
"strings.attributes.quote": "double",
@@ -57,6 +57,6 @@
5757
"struct.multiline.leading_comma": false,
5858
"struct.multiline.leading_comma.padding": true,
5959
"struct.multiline.element_count": 2,
60-
"struct.multiline.min_length": 40,
60+
"struct.multiline.min_length": 60,
6161
"tab_indent": true
6262
}

.github/workflows/ci.yml

Lines changed: 231 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,231 @@
1+
name: cbsecurity 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: cbsecurity
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 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+
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: Cache CommandBox Dependencies
154+
uses: actions/cache@v1
155+
if: ${{ true }}
156+
with:
157+
path: ~/.CommandBox/artifacts
158+
key: ${{ runner.OS }}-commandbox-cache-${{ hashFiles( 'box.json' ) }}-${{ hashFiles( 'test-harness/box.json' ) }}
159+
restore-keys: |
160+
${{ runner.OS }}-commandbox-cache-${{ hashFiles( 'box.json' ) }}-${{ hashFiles( 'test-harness/box.json' ) }}
161+
162+
- name: Setup CommandBox
163+
uses: elpete/[email protected]
164+
with:
165+
forgeboxAPIKey: ${{ secrets.FORGEBOX_TOKEN }}
166+
167+
- name: Setup Environment Variables For Build Process
168+
id: current_version
169+
run: |
170+
echo "VERSION=`cat box.json | jq '.version' -r`" >> $GITHUB_ENV
171+
172+
# master or snapshot
173+
echo "Github Ref is $GITHUB_REF"
174+
echo "BRANCH=master" >> $GITHUB_ENV
175+
if [ $GITHUB_REF == 'refs/heads/development' ]
176+
then
177+
echo "BRANCH=development" >> $GITHUB_ENV
178+
fi
179+
180+
- name: Build ${{ env.MODULE_ID }}
181+
run: |
182+
box install commandbox-docbox
183+
box task run taskfile=build/Build target=run :version=${{ env.VERSION }} :projectName=${{ env.MODULE_ID }} :buildID=${{ github.run_number }} :branch=${{ env.BRANCH }}
184+
185+
- name: Upload Build Artifacts
186+
if: success()
187+
uses: actions/upload-artifact@v2
188+
with:
189+
name: ${{ env.MODULE_ID }}
190+
path: |
191+
.artifacts/**/*
192+
193+
- name: Upload Binaries to S3
194+
uses: jakejarvis/s3-sync-action@master
195+
with:
196+
args: --acl public-read
197+
env:
198+
AWS_S3_BUCKET: "downloads.ortussolutions.com"
199+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
200+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ACCESS_SECRET }}
201+
SOURCE_DIR: ".artifacts/${{ env.MODULE_ID }}"
202+
DEST_DIR: "ortussolutions/coldbox-modules/${{ env.MODULE_ID }}"
203+
204+
- name: Upload API Docs to S3
205+
uses: jakejarvis/s3-sync-action@master
206+
with:
207+
args: --acl public-read
208+
env:
209+
AWS_S3_BUCKET: "apidocs.ortussolutions.com"
210+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
211+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ACCESS_SECRET }}
212+
SOURCE_DIR: ".tmp/apidocs"
213+
DEST_DIR: "coldbox-modules/${{ env.MODULE_ID }}/${{ env.VERSION }}"
214+
215+
- name: Publish To ForgeBox
216+
run: |
217+
cd .tmp/${{ env.MODULE_ID }}
218+
cat box.json
219+
box forgebox publish
220+
221+
- name: Inform Slack
222+
if: ${{ always() }}
223+
uses: rtCamp/action-slack-notify@v2
224+
env:
225+
SLACK_CHANNEL: coding
226+
SLACK_COLOR: ${{ job.status }} # or a specific color like 'green' or '#ff00ff'
227+
SLACK_ICON_EMOJI: ":bell:"
228+
SLACK_MESSAGE: '${{ env.MODULE_ID }} Built with ${{ job.status }}!'
229+
SLACK_TITLE: "${{ env.MODULE_ID }} Build"
230+
SLACK_USERNAME: CI
231+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}

0 commit comments

Comments
 (0)