Skip to content

Commit

Permalink
Merge pull request #6 from coldbox-modules/ci/addBoxlangToMatrix
Browse files Browse the repository at this point in the history
Ci/add boxlang to matrix
  • Loading branch information
jclausen authored Dec 16, 2024
2 parents d2f0801 + e576aee commit 8022060
Show file tree
Hide file tree
Showing 20 changed files with 229 additions and 91 deletions.
1 change: 1 addition & 0 deletions .cfconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
30 changes: 19 additions & 11 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,17 @@ jobs:
tests:
name: Tests
runs-on: ubuntu-20.04
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
cfengine: [ "lucee@5", "lucee@6", "adobe@2021", "adobe@2023" ]
coldboxVersion: [ "^6.0.0", "^7.0.0" ]
experimental: [ false ]
include:
- coldboxVersion: "be"
cfengine: "boxlang@1"
experimental: true
steps:
- name: Checkout Repository
uses: actions/checkout@v2
Expand All @@ -25,7 +32,7 @@ jobs:
uses: Ortus-Solutions/setup-commandbox@main

- name: Cache CommandBox Dependencies
uses: actions/cache@v1
uses: actions/cache@v4
if: ${{ true }}
with:
path: ~/.CommandBox/artifacts
Expand All @@ -35,47 +42,48 @@ jobs:
- name: Install Test Harness Dependencies
run: |
box package set dependencies.coldbox=${{ matrix.coldboxVersion }}
box install
- name: Start ${{ matrix.cfengine }} Server
run: |
box server start cfengine=${{ matrix.cfengine }} port=49619 --noSaveSettings --debug
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:49619
curl http://127.0.0.1:60299
- name: Run Tests
run: |
mkdir -p tests/results
box testbox run runner=http://127.0.0.1:49619/tests/runner.cfm --verbose outputFile=tests/results/test-results outputFormats=json,antjunit
box testbox run runner=http://127.0.0.1:60299/tests/runner.cfm --verbose outputFile=tests/results/test-results outputFormats=json,antjunit
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: tests/results/**/*.xml
junit_files: tests/results/**/*.xml
check_name: "${{ matrix.cfengine }} Test Results"

- name: Upload Test Results to Artifacts
if: always()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.cfengine }}
name: test-results-${{ matrix.cfengine }}-${{ matrix.coldboxVersion }}
path: |
tests/results/**/*
- name: Show Server Log On Failures
if: ${{ failure() }}
run: |
box server log
box server log serverConfigFile="server-${{ matrix.cfengine }}.json"
- name: Upload Debug Logs To Artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: Failure Debugging Info - ${{ matrix.cfengine }}
name: Failure Debugging Info - ${{ matrix.cfengine }} - ${{ matrix.coldboxVersion }}
path: |
.engine/**/logs/*
.engine/**/WEB-INF/cfusion/logs/*
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,10 @@ moduleSettings = {
};
```

Note: if you only a username or a password, `sendgrid-sdk` will return a 500 error.
Note: if you only a username or a password, `sendgrid-sdk` will return a 500 error.

## Systema requirements

* [Boxlang](https://www.boxlang.io/)
* Adobe 2021+
* Lucee 5+
2 changes: 1 addition & 1 deletion box.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"testbox":"testbox/"
},
"testbox":{
"runner":"http://localhost:49616"
"runner":"http://localhost:60299"
},
"scripts":{
"format":"cfformat run modules/sendgrid-sdk/**/*.cfc,tests/resources/**/*.cfc,tests/specs/**/*.cfc --overwrite",
Expand Down
22 changes: 22 additions & 0 deletions [email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"force":true,
"openbrowser":"false",
"name": "sendgrid-sdk-adobe@2021",
"web":{
"directoryBrowsing":true,
"http":{
"port":"60299"
},
"rewrites":{
"enable":"true"
},
"webroot":"./",
"aliases":{
"/moduleroot/sendgrid-sdk":"./"
}
},
"app":{
"serverHomeDirectory":".engine/adobe2021",
"cfengine":"adobe@2021"
}
}
22 changes: 22 additions & 0 deletions [email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"force":true,
"openbrowser":"false",
"name": "sendgrid-sdk-adobe@2023",
"web":{
"directoryBrowsing":true,
"http":{
"port":"60299"
},
"rewrites":{
"enable":"true"
},
"webroot":"./",
"aliases":{
"/moduleroot/sendgrid-sdk":"./"
}
},
"app":{
"serverHomeDirectory":".engine/adobe2023",
"cfengine":"adobe@2023"
}
}
36 changes: 36 additions & 0 deletions [email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"app":{
"cfengine":"boxlang@be",
"serverHomeDirectory":".engine/boxlang"
},
"name":"sendgrid-sdk-boxlang@1",
"force":true,
"openBrowser":false,
"web":{
"directoryBrowsing":true,
"http":{
"port":"60299"
},
"rewrites":{
"enable":"true"
},
"webroot":"./",
"aliases":{
"/moduleroot/sendgrid-sdk":"./"
}
},
"JVM":{
"heapSize":"1024",
"javaVersion":"openjdk21_jdk",
"args":"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=9999"
},
"cfconfig":{
"file":".cfconfig.json"
},
"env":{
"BOXLANG_DEBUG":true
},
"scripts":{
"onServerInitialInstall":"install bx-mail,bx-mysql,bx-derby,bx-compat-cfml@be,bx-unsafe-evaluate,bx-esapi --noSave"
}
}
24 changes: 24 additions & 0 deletions [email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name":"sendgrid-sdk-lucee@5",
"app":{
"serverHomeDirectory":".engine/lucee5",
"cfengine":"lucee@5"
},
"web":{
"directoryBrowsing":true,
"http":{
"port":"60299"
},
"rewrites":{
"enable":"true"
},
"webroot":"./",
"aliases":{
"/moduleroot/sendgrid-sdk":"./"
}
},
"jvm":{
"heapSize":"1024"
},
"openBrowser":"false"
}
24 changes: 24 additions & 0 deletions [email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name":"sendgrid-sdk-lucee@6",
"app":{
"serverHomeDirectory":".engine/lucee6",
"cfengine":"lucee@6"
},
"web":{
"directoryBrowsing":true,
"http":{
"port":"60299"
},
"rewrites":{
"enable":"true"
},
"webroot":"./",
"aliases":{
"/moduleroot/sendgrid-sdk":"./"
}
},
"jvm":{
"heapSize":"1024"
},
"openBrowser":"false"
}
12 changes: 6 additions & 6 deletions tests/resources/app/Application.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ component {
COLDBOX_APP_KEY = "";

// application start
public boolean function onApplicationStart() {
public boolean function onApplicationStart(){
application.cbBootstrap = new coldbox.system.Bootstrap(
COLDBOX_CONFIG_FILE,
COLDBOX_APP_ROOT_PATH,
Expand All @@ -40,27 +40,27 @@ component {
}

// application end
public void function onApplicationEnd( struct appScope ) {
public void function onApplicationEnd( struct appScope ){
arguments.appScope.cbBootstrap.onApplicationEnd( arguments.appScope );
}

// request start
public boolean function onRequestStart( string targetPage ) {
public boolean function onRequestStart( string targetPage ){
// Process ColdBox Request
application.cbBootstrap.onRequestStart( arguments.targetPage );

return true;
}

public void function onSessionStart() {
public void function onSessionStart(){
application.cbBootStrap.onSessionStart();
}

public void function onSessionEnd( struct sessionScope, struct appScope ) {
public void function onSessionEnd( struct sessionScope, struct appScope ){
arguments.appScope.cbBootStrap.onSessionEnd( argumentCollection = arguments );
}

public boolean function onMissingTemplate( template ) {
public boolean function onMissingTemplate( template ){
return application.cbBootstrap.onMissingTemplate( argumentCollection = arguments );
}

Expand Down
2 changes: 1 addition & 1 deletion tests/resources/app/config/CacheBox.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ component {
/**
* Configure CacheBox for ColdBox Application Operation
*/
function configure() {
function configure(){
/**
* --------------------------------------------------------------------------
* CacheBox Configuration (https://cachebox.ortusbooks.com)
Expand Down
16 changes: 8 additions & 8 deletions tests/resources/app/config/Coldbox.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ component {
/**
* Configure the ColdBox App For Production
*/
function configure() {
function configure(){
/**
* --------------------------------------------------------------------------
* ColdBox Directives
Expand Down Expand Up @@ -138,12 +138,12 @@ component {
* }
*/
moduleSettings = {
"sendgrid-sdk" = {
"username" = "foo",
"password" = "bar",
"emailValidationAPIKey" = "[YOUR API KEY HERE]"
}
};
"sendgrid-sdk" : {
"username" : "foo",
"password" : "bar",
"emailValidationAPIKey" : "[YOUR API KEY HERE]"
}
};

/**
* --------------------------------------------------------------------------
Expand Down Expand Up @@ -177,7 +177,7 @@ component {
/**
* Development environment
*/
function development() {
function development(){
// coldbox.customErrorTemplate = "/coldbox/system/exceptions/BugReport.cfm"; // static bug reports
coldbox.customErrorTemplate = "/coldbox/system/exceptions/Whoops.cfm"; // interactive bug report
}
Expand Down
11 changes: 4 additions & 7 deletions tests/resources/app/config/Router.cfc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
component {

function configure() {
function configure(){
// Set Full Rewrites
setFullRewrites( true );

Expand All @@ -15,16 +15,13 @@ component {
*/

// A nice healthcheck route example
route( "/healthcheck", function( event, rc, prc ) {
route( "/healthcheck", function( event, rc, prc ){
return "Ok!";
} );

// A nice RESTFul Route example
route( "/api/echo", function( event, rc, prc ) {
return {
"error" : false,
"data" : "Welcome to my awesome API!"
};
route( "/api/echo", function( event, rc, prc ){
return { "error" : false, "data" : "Welcome to my awesome API!" };
} );

// Conventions based routing
Expand Down
Loading

0 comments on commit 8022060

Please sign in to comment.