Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
lmajano committed Feb 4, 2022
2 parents e4e7913 + b4b642a commit 6f264e9
Show file tree
Hide file tree
Showing 29 changed files with 933 additions and 638 deletions.
23 changes: 12 additions & 11 deletions .cfformat.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"array.empty_padding": false,
"array.padding": true,
"array.multiline.min_length": 40,
"array.multiline.min_length": 50,
"array.multiline.element_count": 2,
"array.multiline.leading_comma.padding": true,
"array.multiline.leading_comma": false,
"alignment.consecutive.assignments": true,
"alignment.consecutive.properties": true,
"alignment.consecutive.params": true,
"alignment.doc_comments" : true,
"brackets.padding": true,
"comment.asterisks": "align",
"binary_operators.padding": true,
Expand All @@ -19,20 +20,20 @@
"function_call.casing.userdefined": "camel",
"function_call.multiline.element_count": 3,
"function_call.multiline.leading_comma": false,
"function_call.multiline.min_length": 40,
"function_call.multiline.min_length": 50,
"function_declaration.padding": true,
"function_declaration.empty_padding": false,
"function_declaration.multiline.leading_comma": false,
"function_declaration.multiline.leading_comma.padding": true,
"function_declaration.multiline.element_count": 3,
"function_declaration.multiline.min_length": 40,
"function_declaration.group_to_block_spacing": "spaced",
"function_declaration.multiline.min_length": 50,
"function_declaration.group_to_block_spacing": "compact",
"function_anonymous.empty_padding": false,
"function_anonymous.group_to_block_spacing": "spaced",
"function_anonymous.group_to_block_spacing": "compact",
"function_anonymous.multiline.element_count": 3,
"function_anonymous.multiline.leading_comma": false,
"function_anonymous.multiline.leading_comma.padding": true,
"function_anonymous.multiline.min_length": 40,
"function_anonymous.multiline.min_length": 50,
"function_anonymous.padding": true,
"indent_size": 4,
"keywords.block_to_keyword_spacing": "spaced",
Expand All @@ -41,22 +42,22 @@
"keywords.spacing_to_block": "spaced",
"keywords.spacing_to_group": true,
"keywords.empty_group_spacing": false,
"max_columns": 120,
"max_columns": 115,
"metadata.multiline.element_count": 3,
"metadata.multiline.min_length": 40,
"metadata.multiline.min_length": 50,
"method_call.chain.multiline" : 3,
"newline":"\n",
"property.multiline.element_count": 3,
"property.multiline.min_length": 40,
"property.multiline.min_length": 30,
"parentheses.padding": true,
"strings.quote": "double",
"strings.convertNestedQuotes": false,
"strings.attributes.quote": "double",
"struct.separator": " : ",
"struct.padding": true,
"struct.empty_padding": false,
"struct.multiline.leading_comma": false,
"struct.multiline.leading_comma.padding": true,
"struct.multiline.element_count": 2,
"struct.multiline.min_length": 40,
"struct.multiline.min_length": 60,
"tab_indent": true
}
3 changes: 2 additions & 1 deletion .cflintrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
{ "code": "AVOID_USING_CFINSERT_TAG" },
{ "code": "AVOID_USING_CFUPDATE_TAG" },
{ "code": "ARG_VAR_CONFLICT" },
{ "code": "ARG_VAR_MIXED" },
{ "code": "ARG_HINT_MISSING" },
{ "code": "ARG_HINT_MISSING_SCRIPT" },
{ "code" : "ARGUMENT_INVALID_NAME" },
Expand Down Expand Up @@ -58,4 +59,4 @@
"parameters": {
"TooManyFunctionsChecker.maximum" : 20
}
}
}
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ indent_size = 2

[*.{md,markdown}]
trim_trailing_whitespace = false
insert_final_newline = false
insert_final_newline = false
1 change: 1 addition & 0 deletions .github/FUNDING.YML
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
patreon: ortussolutions
129 changes: 129 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
name: Module CI

# Only on Development we build snapshots
on:
push:
branches:
- development
- master

# UPDATE WITH THE RIGHT MODULE NAME
env:
MODULE_ID: cbjavaloader

jobs:
#############################################
# Tests First baby! We fail, no build :(
#############################################
tests:
uses: ./.github/workflows/tests.yml
secrets:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

#############################################
# Build Module
#############################################
build:
name: Build & Publish
needs: tests
runs-on: ubuntu-20.04
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup Java
uses: actions/setup-java@v2
with:
distribution: "adopt"
java-version: "11"

#- name: Setup nodejs
# uses: actions/setup-node@v2
# with:
# node-version: 12.x

- name: Cache CommandBox Dependencies
uses: actions/cache@v1
if: ${{ true }}
with:
path: ~/.CommandBox/artifacts
key: ${{ runner.OS }}-commandbox-cache-${{ hashFiles( 'box.json' ) }}-${{ hashFiles( 'test-harness/box.json' ) }}
restore-keys: |
${{ runner.OS }}-commandbox-cache-${{ hashFiles( 'box.json' ) }}-${{ hashFiles( 'test-harness/box.json' ) }}
- name: Setup CommandBox
uses: Ortus-Solutions/setup-commandbox@main
with:
forgeboxAPIKey: ${{ secrets.FORGEBOX_TOKEN }}

- name: Setup Environment Variables For Build Process
id: current_version
run: |
echo "VERSION=`cat box.json | jq '.version' -r`" >> $GITHUB_ENV
box package set [email protected]@[email protected]@
# master or snapshot
echo "Github Ref is $GITHUB_REF"
echo "BRANCH=master" >> $GITHUB_ENV
if [ $GITHUB_REF == 'refs/heads/development' ]
then
echo "BRANCH=development" >> $GITHUB_ENV
fi
- name: Build ${{ env.MODULE_ID }}
run: |
#npm i npm@latest -g
#npm install
#npm run prod
#rm -Rf node_modules
box install commandbox-docbox
box task run taskfile=build/Build target=run :version=${{ env.VERSION }} :projectName=${{ env.MODULE_ID }} :buildID=${{ github.run_number }} :branch=${{ env.BRANCH }}
- name: Upload Build Artifacts
if: success()
uses: actions/upload-artifact@v2
with:
name: ${{ env.MODULE_ID }}
path: |
.artifacts/**/*
- name: Upload Binaries to S3
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read
env:
AWS_S3_BUCKET: "downloads.ortussolutions.com"
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ACCESS_SECRET }}
SOURCE_DIR: ".artifacts/${{ env.MODULE_ID }}"
DEST_DIR: "ortussolutions/coldbox-modules/${{ env.MODULE_ID }}"

- name: Upload API Docs to S3
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read
env:
AWS_S3_BUCKET: "apidocs.ortussolutions.com"
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ACCESS_SECRET }}
SOURCE_DIR: ".tmp/apidocs"
DEST_DIR: "coldbox-modules/${{ env.MODULE_ID }}/${{ env.VERSION }}"

- name: Publish To ForgeBox
run: |
cd .tmp/${{ env.MODULE_ID }}
cat box.json
box forgebox publish
- name: Inform Slack
if: ${{ always() }}
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: '${{ env.MODULE_ID }} Built with ${{ job.status }}!'
SLACK_TITLE: "${{ env.MODULE_ID }} Build"
SLACK_USERNAME: CI
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
33 changes: 33 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Pull Requests

on:
push:
branches-ignore:
- "main"
- "master"
- "development"
pull_request:
branches:
- development

jobs:
# UPDATE TO THE MODULE REPO SO PR'S CAN REUSE IT
tests:
uses: coldbox-modules/cbjavaloader/.github/workflows/tests.yml@development

# Format PR
format:
name: Format
runs-on: ubuntu-20.04
steps:
- name: Checkout Repository
uses: actions/checkout@v2

- uses: Ortus-Solutions/[email protected]
with:
cmd: run-script format

- name: Commit Format Changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Apply cfformat changes
123 changes: 123 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: Test Suites

# We are a reusable Workflow only
on:
workflow_call:
secrets:
SLACK_WEBHOOK_URL:
required: true

jobs:
tests:
name: Tests
runs-on: ubuntu-20.04
env:
DB_USER: root
DB_PASSWORD: root
strategy:
fail-fast: false
matrix:
cfengine: [ "lucee@5", "adobe@2016", "adobe@2018", "adobe@2021" ]
steps:
- name: Checkout Repository
uses: actions/checkout@v2

# Not Needed in this module
#- name: Setup Database and Fixtures
# run: |
# sudo /etc/init.d/mysql start
# mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} -e 'CREATE DATABASE coolblog;'
# mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} < test-harness/tests/resources/coolblog.sql

- name: Setup Java
uses: actions/setup-java@v2
with:
distribution: "adopt"
java-version: "11"

- name: Setup CommandBox CLI
uses: Ortus-Solutions/setup-commandbox@main

# Not Needed in this module
#- name: Setup Environment For Testing Process
# working-directory: ./test-harness
# run: |
# # Setup .env
# touch .env
# # ENV
# printf "DB_HOST=localhost\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: Cache CommandBox Dependencies
uses: actions/cache@v1
if: ${{ true }}
with:
path: ~/.CommandBox/artifacts
key: ${{ runner.OS }}-commandbox-cache-${{ hashFiles( 'box.json' ) }}-${{ hashFiles( 'test-harness/box.json' ) }}
restore-keys: |
${{ runner.OS }}-commandbox-cache-${{ hashFiles( 'box.json' ) }}-${{ hashFiles( 'test-harness/box.json' ) }}
- name: Install Test Harness Dependencies
working-directory: ./test-harness
run: |
box install
- name: Start ${{ matrix.cfengine }} Server
run: |
box server start serverConfigFile="server-${{ matrix.cfengine }}.json" --noSaveSettings --debug
# Install Adobe 2021 cfpm modules
if [[ "${{ matrix.cfengine }}" == "adobe@2021" ]] ; then
box run-script install:2021
fi
curl http://127.0.0.1:60299
- name: Run Tests
run: |
mkdir -p test-harness/tests/results
box testbox run --verbose outputFile=test-harness/tests/results/test-results outputFormats=json,antjunit
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
if: always()
with:
files: test-harness/tests/results/**/*.xml
check_name: "${{ matrix.cfengine }} Test Results"

- name: Upload Test Results to Artifacts
if: always()
uses: actions/upload-artifact@v2
with:
name: test-results-${{ matrix.cfengine }}
path: |
test-harness/tests/results/**/*
- name: Show Server Log On Failures
if: ${{ failure() }}
run: |
box server log serverConfigFile="server-${{ matrix.cfengine }}.json"
- name: Upload Debug Logs To Artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: Failure Debugging Info - ${{ matrix.cfengine }}
path: |
.engine/**/logs/*
.engine/**/WEB-INF/cfusion/logs/*
- name: Slack Notifications
# 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: '${{ env.MODULE_ID }} tests failed :cry:'
SLACK_TITLE: ${{ env.MODULE_ID }} Tests For ${{ matrix.cfengine }} failed
SLACK_USERNAME: CI
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.artifacts/**
.tmp/**

.engine/**
test-harness/.engine/**
test-harness/coldbox/**
test-harness/docbox/**
Expand All @@ -11,4 +12,4 @@ test-harness/logs/**
test-harness/modules/**

# log files
logs/**
logs/**
Loading

0 comments on commit 6f264e9

Please sign in to comment.