Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
lmajano committed Sep 23, 2022
2 parents 41efa04 + 49d0fb4 commit e999329
Show file tree
Hide file tree
Showing 33 changed files with 997 additions and 747 deletions.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions .github/FUNDING.YML
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
patreon: ortussolutions
127 changes: 4 additions & 123 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,119 +15,9 @@ jobs:
# Tests First baby! We fail, no build :(
#############################################
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

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

- name: Setup Database and Fixtures
run: |
sudo systemctl start mysql.service
# Create Database
mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} -e 'CREATE DATABASE mementifier;'
- 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: Setup CommandBox
uses: elpete/[email protected]

- name: Install Test Harness Dependencies
working-directory: ./test-harness
run: |
box install
- name: Start ${{ matrix.cfengine }} Server
working-directory: ./test-harness
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
working-directory: ./test-harness
run: |
mkdir tests/results
box package set testbox.runner="http://localhost:60299/tests/runner.cfm"
box testbox run --verbose outputFile=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 Artifacts
if: always()
uses: actions/upload-artifact@v2
with:
name: test-results-${{ matrix.cfengine }}
path: |
test-harness/tests/results/**/*
- name: Slack Notification
if: failure()
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 }}

- name: Failure Debugging Info
if: ${{ failure() }}
working-directory: ./test-harness
run: |
box server log serverConfigFile="server-${{ matrix.cfengine }}.json"
- name: Upload Debugging Info To Artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: Failure Debugging Info - ${{ matrix.cfengine }}
path: |
test-harness/.engine/**/logs/*
test-harness/.engine/**/WEB-INF/cfusion/logs/*
uses: ./.github/workflows/tests.yml
secrets:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

#############################################
# Build Module
Expand All @@ -148,17 +38,8 @@ jobs:
distribution: "adopt"
java-version: "11"

- 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: elpete/setup-commandbox@v1.0.0
uses: Ortus-Solutions/setup-commandbox@main
with:
forgeboxAPIKey: ${{ secrets.FORGEBOX_TOKEN }}

Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/gh-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Pull Requests

on:
pull_request:
branches:
- development

jobs:
tests:
uses: coldbox-modules/MockDataCFC/.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
94 changes: 4 additions & 90 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,105 +12,19 @@ on:

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

- name: Setup Database and Fixtures
run: |
sudo systemctl start mysql.service
mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} -e 'CREATE DATABASE mementifier;'
- name: Setup Java
uses: actions/setup-java@v2
with:
distribution: "adopt"
java-version: "11"

- name: Setup CommandBox
uses: elpete/[email protected]

- 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: Install Test Harness Dependencies
working-directory: ./test-harness
run: |
box install
- name: Start ${{ matrix.cfengine }} Server
working-directory: ./test-harness
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
working-directory: ./test-harness
run: |
mkdir tests/results
box package set testbox.runner="http://localhost:60299/tests/runner.cfm"
box testbox run --verbose outputFile=tests/results/test-results outputFormats=json,antjunit
- name: Publish PR Test Reports
uses: mikepenz/action-junit-report@v2
with:
report_paths: 'test-harness/tests/results/**/*.xml'
check_name: "${{ matrix.cfengine }} Test Results"
summary: true

- name: Failure Debugging Info
if: ${{ failure() }}
working-directory: ./test-harness
run: |
box server log serverConfigFile="server-${{ matrix.cfengine }}.json"
if [[ "${{ matrix.cfengine }}" == "lucee-hibernate@5" ]] ; then
box cat "`box server info name=cborm-${{ matrix.cfengine }} property=serverHomeDirectory`/WEB-INF/lucee-server/context/logs/deploy.log"
fi
uses: coldbox-modules/mementifier/.github/workflows/tests.yml@development

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

- name: Setup Java
uses: actions/setup-java@v2
- uses: Ortus-Solutions/[email protected]
with:
distribution: "adopt"
java-version: "11"

- name: Set Up CommandBox
uses: elpete/[email protected]

- name: Install CFFormat
run: box install commandbox-cfformat

- name: Run CFFormat
run: box run-script format
cmd: run-script format

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

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

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@2018", "adobe@2021" ]
steps:
- name: Checkout Repository
uses: actions/checkout@v2

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

- name: Setup Database and Fixtures
run: |
sudo systemctl start mysql.service
# Create Database
mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} -e 'CREATE DATABASE mementifier;'
# Import Database
#mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} < test-harness/tests/resources/coolblog.sql
- name: Setup Environment For Testing Process
run: |
# Setup .env
touch .env
# ENV
printf "ENVIRONMENT=development\n" >> .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: Setup CommandBox CLI
uses: Ortus-Solutions/setup-commandbox@main
with:
version: 5.4.2

- name: Install Dependencies
run: |
box install
cd test-harness && 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
ls -lR test-harness/tests
- 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: Failure Debugging Log
if: ${{ failure() }}
run: |
box server log serverConfigFile="server-${{ matrix.cfengine }}.json"
- name: Upload Debugging Log 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: '${{ github.repository }} tests failed :cry:'
SLACK_TITLE: ${{ github.repository }} Tests For ${{ matrix.cfengine }} failed
SLACK_USERNAME: CI
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
Loading

0 comments on commit e999329

Please sign in to comment.