Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v4 major update #11

Merged
merged 11 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@ on:
jobs:
tests:
uses: ./.github/workflows/tests.yml
secrets: inherit

formatCheck:
# Format PR
format_check:
name: Checks Source Code Formatting
runs-on: ubuntu-20.04
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- uses: Ortus-Solutions/[email protected].2
- uses: Ortus-Solutions/[email protected].3
with:
cmd: run-script format:check
58 changes: 46 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build a Release
name: Release

on:
# If you push to master|main this will trigger a stable release
Expand All @@ -16,17 +16,27 @@ on:
default: false
type: boolean

# Manual Trigger
workflow_dispatch:

env:
MODULE_ID: MockDataCFC
MODULE_ID: ${{ github.event.repository.name }}
JDK: 21
SNAPSHOT: ${{ inputs.snapshot || false }}
BUILD_ID: ${{ github.run_number }}

jobs:
##########################################################################################
# Build & Publish
##########################################################################################
build:
name: Build & Publish
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
permissions:
checks: write
pull-requests: write
contents: write
issues: write
steps:
- name: Checkout Repository
uses: actions/checkout@v4
Expand All @@ -36,6 +46,12 @@ jobs:
with:
forgeboxAPIKey: ${{ secrets.FORGEBOX_TOKEN }}

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: ${{ env.JDK }}

- name: "Setup Environment Variables For Build Process"
id: current_version
run: |
Expand All @@ -50,7 +66,7 @@ jobs:
fi

- name: Update changelog [unreleased] with latest version
uses: thomaseizinger/keep-a-changelog-new-release@1.3.0
uses: thomaseizinger/keep-a-changelog-new-release@3.1.0
if: env.SNAPSHOT == 'false'
with:
changelogPath: ./changelog.md
Expand All @@ -61,10 +77,10 @@ jobs:
npm install -g markdownlint-cli
markdownlint changelog.md --fix
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 }}
box task run taskfile=build/Build target=run :version=${{ env.VERSION }} :projectName=${{ env.MODULE_ID }} :buildID=${{ env.BUILD_ID }} :branch=${{ env.BRANCH }}

- name: Commit Changelog To Master
uses: EndBug/[email protected].1
- name: Commit Changelog [unreleased] with latest version
uses: EndBug/[email protected].4
if: env.SNAPSHOT == 'false'
with:
author_name: Github Actions
Expand All @@ -73,7 +89,7 @@ jobs:
add: changelog.md

- name: Tag Version
uses: rickstaa/action-create-tag@v1.6.1
uses: rickstaa/action-create-tag@v1.7.2
if: env.SNAPSHOT == 'false'
with:
tag: "v${{ env.VERSION }}"
Expand Down Expand Up @@ -118,23 +134,41 @@ jobs:
box forgebox publish --force

- name: Create Github Release
uses: taiki-e/create-gh-release-action@v1.6.2
uses: taiki-e/create-gh-release-action@v1.8.0
continue-on-error: true
if: env.SNAPSHOT == 'false'
id: create_release
with:
title: ${{ env.VERSION }}
changelog: changelog.md
token: ${{ secrets.GITHUB_TOKEN }}
ref: refs/tags/v${{ env.VERSION }}

- 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: "Module ${{ env.MODULE_ID }} v${{ env.VERSION }} Built with ${{ job.status }}!"
SLACK_TITLE: "ColdBox Module ${{ env.MODULE_ID }}"
SLACK_USERNAME: CI
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}

##########################################################################################
# Prep Next Release
##########################################################################################
prep_next_release:
name: Prep Next Release
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
needs: [ build ]
permissions:
checks: write
pull-requests: write
contents: write
issues: write
steps:
# Checkout development
- name: Checkout Repository
Expand All @@ -148,7 +182,7 @@ jobs:
forgeboxAPIKey: ${{ secrets.FORGEBOX_TOKEN }}

- name: Download build artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: ${{ env.MODULE_ID }}
path: .tmp
Expand All @@ -165,7 +199,7 @@ jobs:

# Commit it back to development
- name: Commit Version Bump
uses: EndBug/[email protected].1
uses: EndBug/[email protected].4
with:
author_name: Github Actions
author_email: [email protected]
Expand Down
34 changes: 28 additions & 6 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,47 @@ on:
branches:
- 'development'

# Cancel running builds if another push to branch is made while this build is running
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
MODULE_ID: ${{ github.event.repository.name }}
JDK_VERSION: 21

jobs:
##########################################################################################
# Module Tests
##########################################################################################
#############################################
# Tests First baby! We fail, no build :(
#############################################
tests:
secrets: inherit
uses: ./.github/workflows/tests.yml
permissions:
checks: write
pull-requests: write
contents: read
issues: read

##########################################################################################
# Format Source Code
##########################################################################################
format:
name: Code Auto-Formatting
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
permissions:
contents: write
checks: write
steps:
- uses: actions/checkout@v4

- name: Auto-format
uses: Ortus-Solutions/[email protected].2
uses: Ortus-Solutions/[email protected].3
with:
cmd: run-script format

- name: Commit Format Changes
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Apply cfformat changes

Expand All @@ -39,5 +56,10 @@ jobs:
uses: ./.github/workflows/release.yml
needs: [ tests, format ]
secrets: inherit
permissions:
checks: write
pull-requests: write
contents: write
issues: write
with:
snapshot: true
48 changes: 29 additions & 19 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,59 +7,69 @@ on:
SLACK_WEBHOOK_URL:
required: false

env:
MODULE_ID: ${{ github.event.repository.name }}

jobs:
tests:
name: Tests
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
env:
DB_USER: root
DB_PASSWORD: root
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
cfengine: [ "lucee@5", "adobe@2018", "adobe@2021", "adobe@2023" ]
cfengine: [ "boxlang@1", "lucee@5", "lucee@6", "adobe@2023" ]
coldboxVersion: [ "^6.0.0", "^7.0.0" ]
jdkVersion: [ "21" ]
experimental: [ false ]
include:
# Adobe 2021 JDK11
- cfengine: "adobe@2021"
coldboxVersion: "^7.0.0"
jdkVersion: 11
experimental: false
# Bleeding Edge Tests
- coldboxVersion: "be"
cfengine: "lucee@5"
experimental: true
- coldboxVersion: "be"
cfengine: "lucee@6"
cfengine: "boxlang@1"
jdkVersion: 21
experimental: true
- coldboxVersion: "be"
cfengine: "adobe@2018"
cfengine: "lucee@5"
jdkVersion: 21
experimental: true
- coldboxVersion: "be"
cfengine: "adobe@2021"
cfengine: "lucee@6"
jdkVersion: 21
experimental: true
- coldboxVersion: "be"
cfengine: "adobe@2023"
jdkVersion: 21
experimental: true
steps:
- name: Checkout Repository
uses: actions/checkout@v4

# 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
# DATABASE SETUP: uncomment if you need to setup a database
# - name: Setup Database and Fixtures
# run: |
# sudo systemctl start mysql.service
# mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} -e 'CREATE DATABASE mementifier;'
# mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} < test-harness/tests/resources/coolblog.sql

- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "11"
java-version: ${{ matrix.jdkVersion }}

- name: Setup CommandBox CLI
uses: Ortus-Solutions/[email protected]

# Not Needed in this module
#- name: Setup Environment For Testing Process
# working-directory: ./test-harness
# run: |
# # Setup .env
# touch .env
Expand All @@ -75,10 +85,10 @@ jobs:

- name: Install Test Harness with ColdBox ${{ matrix.coldboxVersion }}
run: |
box install
box install --verbose
cd test-harness
box package set dependencies.coldbox=${{ matrix.coldboxVersion }}
box install
box install --verbose

- name: Start ${{ matrix.cfengine }} Server
run: |
Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing Guide

Hola amigo! I'm really excited that you are interested in contributing to mockdatacfc. Before submitting your contribution, please make sure to take a moment and read through the following guidelines:
Hola amigo! I'm really excited that you are interested in contributing to cbMockData. Before submitting your contribution, please make sure to take a moment and read through the following guidelines:

- [Code Of Conduct](#code-of-conduct)
- [Bug Reporting](#bug-reporting)
Expand Down Expand Up @@ -98,11 +98,11 @@ You can support ColdBox and all of our Open Source initiatives at Ortus Solution

## Contributors

Thank you to all the people who have already contributed to mockdatacfc! We :heart: :heart: :heart: love you!
Thank you to all the people who have already contributed to cbMockData! We :heart: :heart: :heart: love you!


<a href = "https://github.com/coldbox-modules/mockdatacfc/graphs/contributors">
<img src = "https://contrib.rocks/image?repo=coldbox-modules/mockdatacfc"/>
<a href = "https://github.com/coldbox-modules/cbMockData/graphs/contributors">
<img src = "https://contrib.rocks/image?repo=coldbox-modules/cbMockData"/>
</a>

Made with [contributors-img](https://contrib.rocks)
10 changes: 5 additions & 5 deletions ModuleConfig.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@
component {

// Module Properties
this.title = "MockDataCFC";
this.title = "cbMockData";
this.author = "Luis Majano";
this.webURL = "https://www.ortussolutions.com";
this.description = "MockData is a service to generate fake JSON data";
this.description = "cbMockData is a service to generate fake JSON data";
// If true, looks for views in the parent first, if not found, then in the module. Else vice-versa
this.viewParentLookup = true;
// If true, looks for layouts in the parent first, if not found, then in module. Else vice-versa
this.layoutParentLookup = true;
// Module Entry Point
this.entryPoint = "MockDataCFC";
this.entryPoint = "cbMockData";
// Model Namespace
this.modelNamespace = "MockDataCFC";
this.modelNamespace = "cbMockData";
// CF Mapping
this.cfmapping = "MockDataCFC";
this.cfmapping = "cbMockData";

/**
* Configure Module
Expand Down
Loading
Loading