Skip to content

Commit f2778ed

Browse files
committed
* New module template updates and enhancements
* Update to use the new virtual app from ColdBox 6.7
1 parent 5f42393 commit f2778ed

20 files changed

+283
-228
lines changed
File renamed without changes.

.env.template

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
DB_HOST=127.0.0.1
2+
DB_PORT=3306
3+
DB_USER=root
4+
DB_PASSWORD=mysql
5+
DB_CLASS=com.mysql.cj.jdbc.Driver
6+
DB_BUNDLEVERSION=8.0.19
7+
DB_BUNDLENAME=com.mysql.cj

.github/FUNDING.YML

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
patreon: ortussolutions

.github/workflows/ci.yml

Lines changed: 5 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -11,104 +11,13 @@ env:
1111
MODULE_ID: cbvalidation
1212

1313
jobs:
14-
#############################################
14+
#############################################
1515
# Tests First baby! We fail, no build :(
1616
#############################################
1717
tests:
18-
name: Tests
19-
runs-on: ubuntu-20.04
20-
strategy:
21-
fail-fast: false
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 Java
29-
uses: actions/setup-java@v2
30-
with:
31-
distribution: "adopt"
32-
java-version: "11"
33-
34-
- name: Cache CommandBox Dependencies
35-
uses: actions/cache@v1
36-
if: ${{ true }}
37-
with:
38-
path: ~/.CommandBox/artifacts
39-
key: ${{ runner.OS }}-commandbox-cache-${{ hashFiles( 'box.json' ) }}-${{ hashFiles( 'test-harness/box.json' ) }}
40-
restore-keys: |
41-
${{ runner.OS }}-commandbox-cache-${{ hashFiles( 'box.json' ) }}-${{ hashFiles( 'test-harness/box.json' ) }}
42-
43-
- name: Setup CommandBox
44-
uses: elpete/[email protected]
45-
46-
- name: Install Test Harness Dependencies
47-
working-directory: ./test-harness
48-
run: |
49-
box install
50-
51-
- name: Start ${{ matrix.cfengine }} Server
52-
working-directory: ./test-harness
53-
run: box server start serverConfigFile="server-${{ matrix.cfengine }}.json" --noSaveSettings --debug
54-
55-
- name: CFPM Setup
56-
if: ${{ matrix.cfengine == 'adobe@2021' }}
57-
working-directory: ./test-harness
58-
run: box run-script install:2021
59-
60-
- name: Prime ${{ matrix.cfengine }} server
61-
working-directory: ./test-harness
62-
run: curl http://127.0.0.1:60299
63-
64-
- name: Run Tests
65-
working-directory: ./test-harness
66-
run: |
67-
mkdir tests/results
68-
box package set testbox.runner="http://localhost:60299/tests/runner.cfm"
69-
box testbox run --verbose outputFile=tests/results/test-results outputFormats=json,antjunit
70-
71-
- name: Publish Test Results
72-
uses: EnricoMi/publish-unit-test-result-action@v1
73-
if: always()
74-
with:
75-
files: test-harness/tests/results/**/*.xml
76-
check_name: "${{ matrix.cfengine }} Test Results"
77-
78-
- name: Upload Test Results Artifacts
79-
if: always()
80-
uses: actions/upload-artifact@v2
81-
with:
82-
name: test-results-${{ matrix.cfengine }}
83-
path: |
84-
test-harness/tests/results/**/*
85-
86-
- name: Slack Notification
87-
if: failure()
88-
uses: rtCamp/action-slack-notify@v2
89-
env:
90-
SLACK_CHANNEL: coding
91-
SLACK_COLOR: ${{ job.status }} # or a specific color like 'green' or '#ff00ff'
92-
SLACK_ICON_EMOJI: ":bell:"
93-
SLACK_MESSAGE: '${{ env.MODULE_ID }} tests failed :cry:'
94-
SLACK_TITLE: ${{ env.MODULE_ID }} Tests For ${{ matrix.cfengine }} failed
95-
SLACK_USERNAME: CI
96-
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
97-
98-
- name: Failure Debugging Info
99-
if: ${{ failure() }}
100-
working-directory: ./test-harness
101-
run: |
102-
box server log serverConfigFile="server-${{ matrix.cfengine }}.json"
103-
104-
- name: Upload Debugging Info To Artifacts
105-
if: ${{ failure() }}
106-
uses: actions/upload-artifact@v2
107-
with:
108-
name: Failure Debugging Info - ${{ matrix.cfengine }}
109-
path: |
110-
test-harness/.engine/**/logs/*
111-
test-harness/.engine/**/WEB-INF/cfusion/logs/*
18+
uses: ./.github/workflows/tests.yml
19+
secrets:
20+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
11221

11322
#############################################
11423
# Build Module
@@ -129,17 +38,8 @@ jobs:
12938
distribution: "adopt"
13039
java-version: "11"
13140

132-
- name: Cache CommandBox Dependencies
133-
uses: actions/cache@v1
134-
if: ${{ true }}
135-
with:
136-
path: ~/.CommandBox/artifacts
137-
key: ${{ runner.OS }}-commandbox-cache-${{ hashFiles( 'box.json' ) }}-${{ hashFiles( 'test-harness/box.json' ) }}
138-
restore-keys: |
139-
${{ runner.OS }}-commandbox-cache-${{ hashFiles( 'box.json' ) }}-${{ hashFiles( 'test-harness/box.json' ) }}
140-
14141
- name: Setup CommandBox
142-
uses: elpete/setup-commandbox@v1.0.0
42+
uses: Ortus-Solutions/setup-commandbox@main
14343
with:
14444
forgeboxAPIKey: ${{ secrets.FORGEBOX_TOKEN }}
14545

.github/workflows/gh-release.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Publish Github Release
2+
name: Github Release
3+
4+
on:
5+
push:
6+
tags:
7+
- v[0-9]+.*
8+
9+
jobs:
10+
create-release:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: taiki-e/[email protected]
15+
with:
16+
# Produced by the build/Build.cfc
17+
changelog: changelog.md
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pr.yml

Lines changed: 5 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -12,89 +12,21 @@ on:
1212

1313
jobs:
1414
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: false
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 Java
29-
uses: actions/setup-java@v2
30-
with:
31-
distribution: "adopt"
32-
java-version: "11"
33-
34-
- name: Setup CommandBox
35-
uses: elpete/[email protected]
36-
37-
- name: Install Test Harness Dependencies
38-
working-directory: ./test-harness
39-
run: |
40-
box install
41-
42-
- name: Start ${{ matrix.cfengine }} Server
43-
working-directory: ./test-harness
44-
run: box server start serverConfigFile="server-${{ matrix.cfengine }}.json" --noSaveSettings --debug
45-
46-
- name: CFPM Setup
47-
if: ${{ matrix.cfengine == 'adobe@2021' }}
48-
working-directory: ./test-harness
49-
run: box run-script install:2021
50-
51-
- name: Prime ${{ matrix.cfengine }} server
52-
working-directory: ./test-harness
53-
run: curl http://127.0.0.1:60299
54-
55-
- name: Run Tests
56-
working-directory: ./test-harness
57-
run: |
58-
mkdir tests/results
59-
box package set testbox.runner="http://localhost:60299/tests/runner.cfm"
60-
box testbox run --verbose outputFile=tests/results/test-results outputFormats=json,antjunit
61-
62-
- name: Publish PR Test Reports
63-
uses: mikepenz/action-junit-report@v2
64-
with:
65-
report_paths: 'test-harness/tests/results/**/*.xml'
66-
check_name: "${{ matrix.cfengine }} Test Results"
67-
summary: true
68-
69-
- name: Failure Debugging Info
70-
if: ${{ failure() }}
71-
working-directory: ./test-harness
72-
run: |
73-
box server log serverConfigFile="server-${{ matrix.cfengine }}.json"
15+
uses: coldbox-modules/cbvalidation/.github/workflows/tests.yml@development
7416

17+
# Format PR
7518
format:
7619
name: Format
7720
runs-on: ubuntu-20.04
7821
steps:
7922
- name: Checkout Repository
8023
uses: actions/checkout@v2
8124

82-
- name: Setup Java
83-
uses: actions/setup-java@v2
25+
- uses: Ortus-Solutions/[email protected]
8426
with:
85-
distribution: "adopt"
86-
java-version: "11"
87-
88-
- name: Set Up CommandBox
89-
uses: elpete/[email protected]
90-
91-
- name: Install CFFormat
92-
run: box install commandbox-cfformat
93-
94-
- name: Run CFFormat
95-
run: box run-script format
27+
cmd: run-script format
9628

9729
- name: Commit Format Changes
9830
uses: stefanzweifel/git-auto-commit-action@v4
9931
with:
100-
commit_message: Apply cfformat changes
32+
commit_message: Apply cfformat changes

.github/workflows/tests.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: Test Suites
2+
3+
# We are a reusable Workflow only
4+
on:
5+
workflow_call:
6+
secrets:
7+
SLACK_WEBHOOK_URL:
8+
required: true
9+
10+
jobs:
11+
tests:
12+
name: Tests
13+
runs-on: ubuntu-20.04
14+
env:
15+
DB_USER: root
16+
DB_PASSWORD: root
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
cfengine: [ "lucee@5", "adobe@2016", "adobe@2018", "adobe@2021" ]
21+
steps:
22+
- name: Checkout Repository
23+
uses: actions/checkout@v2
24+
25+
- name: Setup Java
26+
uses: actions/setup-java@v2
27+
with:
28+
distribution: "adopt"
29+
java-version: "11"
30+
31+
- name: Setup Environment For Testing Process
32+
run: |
33+
# Setup .env
34+
touch .env
35+
# ENV
36+
printf "ENVIRONMENT=development\n" >> .env
37+
printf "DB_HOST=localhost\n" >> .env
38+
printf "DB_USER=${{ env.DB_USER }}\n" >> .env
39+
printf "DB_PASSWORD=${{ env.DB_PASSWORD }}\n" >> .env
40+
printf "DB_CLASS=com.mysql.cj.jdbc.Driver\n" >> .env
41+
printf "DB_BUNDLEVERSION=8.0.19\n" >> .env
42+
printf "DB_BUNDLENAME=com.mysql.cj\n" >> .env
43+
44+
- name: Setup CommandBox CLI
45+
uses: Ortus-Solutions/setup-commandbox@main
46+
47+
- name: Install Dependencies
48+
run: |
49+
box install
50+
cd test-harness && box install
51+
52+
- name: Start ${{ matrix.cfengine }} Server
53+
run: |
54+
box server start serverConfigFile="server-${{ matrix.cfengine }}.json" --noSaveSettings --debug
55+
# Install Adobe 2021 cfpm modules
56+
if [[ "${{ matrix.cfengine }}" == "adobe@2021" ]] ; then
57+
box run-script install:2021
58+
fi
59+
curl http://127.0.0.1:60299
60+
61+
- name: Run Tests
62+
run: |
63+
mkdir -p test-harness/tests/results
64+
box testbox run --verbose outputFile=test-harness/tests/results/test-results outputFormats=json,antjunit
65+
ls -lR test-harness/tests
66+
67+
- name: Publish Test Results
68+
uses: EnricoMi/publish-unit-test-result-action@v1
69+
if: always()
70+
with:
71+
files: test-harness/tests/results/**/*.xml
72+
check_name: "${{ matrix.cfengine }} Test Results"
73+
74+
- name: Upload Test Results to Artifacts
75+
if: always()
76+
uses: actions/upload-artifact@v2
77+
with:
78+
name: test-results-${{ matrix.cfengine }}
79+
path: |
80+
test-harness/tests/results/**/*
81+
82+
- name: Failure Debugging Log
83+
if: ${{ failure() }}
84+
run: |
85+
box server log serverConfigFile="server-${{ matrix.cfengine }}.json"
86+
87+
- name: Upload Debugging Log To Artifacts
88+
if: ${{ failure() }}
89+
uses: actions/upload-artifact@v2
90+
with:
91+
name: Failure Debugging Info - ${{ matrix.cfengine }}
92+
path: |
93+
.engine/**/logs/*
94+
.engine/**/WEB-INF/cfusion/logs/*
95+
96+
- name: Slack Notifications
97+
# Only on failures and NOT in pull requests
98+
if: ${{ failure() && !startsWith( 'pull_request', github.event_name ) }}
99+
uses: rtCamp/action-slack-notify@v2
100+
env:
101+
SLACK_CHANNEL: coding
102+
SLACK_COLOR: ${{ job.status }} # or a specific color like 'green' or '#ff00ff'
103+
SLACK_ICON_EMOJI: ":bell:"
104+
SLACK_MESSAGE: '${{ github.repository }} tests failed :cry:'
105+
SLACK_TITLE: ${{ github.repository }} Tests For ${{ matrix.cfengine }} failed
106+
SLACK_USERNAME: CI
107+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}

.gitignore

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
1-
.vscode
2-
1+
# Artifacts and temp folders
32
.artifacts/**
43
.tmp/**
54

6-
modules/
5+
# Engine + Secrets + databases
6+
.env
7+
.engine/**
8+
.db/**
79

8-
test-harness/.engine/**
9-
test-harness/.env
10+
# Dependencies
1011
test-harness/coldbox/**
1112
test-harness/docbox/**
1213
test-harness/testbox/**
1314
test-harness/logs/**
1415
test-harness/modules/**
1516

17+
# modules
18+
modules/**
19+
1620
# log files
17-
logs/**
21+
logs/**

0 commit comments

Comments
 (0)