Skip to content

Commit eb2fa9f

Browse files
authored
Merge pull request #5 from coldbox-modules/github_actions
Try converting to github actions
2 parents 4e2e729 + b0f73d8 commit eb2fa9f

File tree

12 files changed

+385
-159
lines changed

12 files changed

+385
-159
lines changed

.cfformat.json

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"alignment.consecutive.assignments":false,
3+
"alignment.consecutive.params":false,
4+
"alignment.consecutive.properties":false,
5+
"array.empty_padding":false,
6+
"array.multiline.element_count":4,
7+
"array.multiline.leading_comma":false,
8+
"array.multiline.leading_comma.padding":true,
9+
"array.multiline.min_length":40,
10+
"array.padding":true,
11+
"binary_operators.padding":true,
12+
"brackets.padding":true,
13+
"comment.asterisks":"align",
14+
"for_loop_semicolons.padding":true,
15+
"function_anonymous.empty_padding":false,
16+
"function_anonymous.group_to_block_spacing":"spaced",
17+
"function_anonymous.multiline.element_count":4,
18+
"function_anonymous.multiline.leading_comma":false,
19+
"function_anonymous.multiline.leading_comma.padding":true,
20+
"function_anonymous.multiline.min_length":40,
21+
"function_anonymous.padding":true,
22+
"function_call.casing.builtin":"cfdocs",
23+
"function_call.casing.userdefined":"camel",
24+
"function_call.empty_padding":false,
25+
"function_call.multiline.element_count":4,
26+
"function_call.multiline.leading_comma":false,
27+
"function_call.multiline.leading_comma.padding":true,
28+
"function_call.multiline.min_length":40,
29+
"function_call.padding":true,
30+
"function_declaration.empty_padding":false,
31+
"function_declaration.group_to_block_spacing":"spaced",
32+
"function_declaration.multiline.element_count":4,
33+
"function_declaration.multiline.leading_comma":false,
34+
"function_declaration.multiline.leading_comma.padding":true,
35+
"function_declaration.multiline.min_length":40,
36+
"function_declaration.padding":true,
37+
"indent_size":4,
38+
"keywords.block_to_keyword_spacing":"spaced",
39+
"keywords.empty_group_spacing":false,
40+
"keywords.group_to_block_spacing":"spaced",
41+
"keywords.padding_inside_group":true,
42+
"keywords.spacing_to_block":"spaced",
43+
"keywords.spacing_to_group":true,
44+
"max_columns":120,
45+
"method_call.chain.multiline":3,
46+
"newline":"\n",
47+
"parentheses.padding":true,
48+
"strings.attributes.quote":"double",
49+
"strings.quote":"double",
50+
"struct.empty_padding":false,
51+
"struct.multiline.element_count":4,
52+
"struct.multiline.leading_comma":false,
53+
"struct.multiline.leading_comma.padding":true,
54+
"struct.multiline.min_length":40,
55+
"struct.padding":true,
56+
"struct.separator":": ",
57+
"tab_indent":false
58+
}

.github/workflows/cfformat.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: CFFormat
2+
3+
on:
4+
workflow_dispatch:
5+
repository_dispatch:
6+
types: [cfformat]
7+
push:
8+
branches-ignore:
9+
- "master"
10+
- "development"
11+
paths: # Only run if *.cfc or github workflows are modified
12+
- '**.cfc'
13+
- '.github/workflows/*.yml'
14+
pull_request:
15+
branches:
16+
- development
17+
paths: # Only run if *.cfc or github workflows are modified
18+
- '**.cfc'
19+
- '.github/workflows/*.yml'
20+
21+
jobs:
22+
# Format PR
23+
format:
24+
name: Format
25+
runs-on: ubuntu-20.04
26+
steps:
27+
- name: Checkout Repository
28+
uses: actions/checkout@v2
29+
30+
- uses: Ortus-Solutions/[email protected]
31+
with:
32+
cmd: run-script format
33+
34+
- name: Commit Format Changes
35+
uses: stefanzweifel/git-auto-commit-action@v4
36+
with:
37+
commit_message: Apply cfformat changes

.github/workflows/pr.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Pull Requests
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- "master"
7+
- "development"
8+
pull_request:
9+
branches:
10+
- development
11+
12+
jobs:
13+
tests:
14+
uses: ./.github/workflows/tests.yml

.github/workflows/release.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: sendgrid-sdk CI
2+
3+
# Only on Development we build snapshots
4+
on:
5+
push:
6+
branches:
7+
- development
8+
- master
9+
10+
env:
11+
MODULE_ID: sendgrid-sdk
12+
13+
jobs:
14+
#############################################
15+
# Tests First baby! We fail, no build :(
16+
#############################################
17+
tests:
18+
uses: ./.github/workflows/tests.yml
19+
20+
#############################################
21+
# Build ContentBox
22+
#############################################
23+
build:
24+
name: Build & Publish
25+
needs: tests
26+
runs-on: ubuntu-20.04
27+
steps:
28+
- name: Checkout Repository
29+
uses: actions/checkout@v2
30+
with:
31+
fetch-depth: 0
32+
33+
- name: Setup Java
34+
uses: actions/setup-java@v2
35+
with:
36+
distribution: "adopt"
37+
java-version: "11"
38+
39+
- name: Cache CommandBox Dependencies
40+
uses: actions/cache@v1
41+
if: ${{ true }}
42+
with:
43+
path: ~/.CommandBox/artifacts
44+
key: ${{ runner.OS }}-commandbox-cache-${{ hashFiles( 'box.json' ) }}-${{ hashFiles( 'test-harness/box.json' ) }}
45+
restore-keys: |
46+
${{ runner.OS }}-commandbox-cache-${{ hashFiles( 'box.json' ) }}-${{ hashFiles( 'test-harness/box.json' ) }}
47+
- name: Setup CommandBox
48+
uses: Ortus-Solutions/setup-commandbox@main
49+
with:
50+
forgeboxAPIKey: ${{ secrets.FORGEBOX_TOKEN }}
51+
52+
- name: Setup Environment Variables For Build Process
53+
id: current_version
54+
run: |
55+
cd modules/sendgrid-sdk
56+
echo "VERSION=`cat box.json | jq '.version' -r`" >> $GITHUB_ENV
57+
58+
# main or snapshot
59+
echo "Github Ref is $GITHUB_REF"
60+
echo "BRANCH=main" >> $GITHUB_ENV
61+
if [ $GITHUB_REF == 'refs/heads/development' ]
62+
then
63+
echo "BRANCH=development" >> $GITHUB_ENV
64+
fi
65+
66+
- name: Install and Configure Semantic Release
67+
run: |
68+
box install commandbox-semantic-release
69+
box config set endpoints.forgebox.APIToken=${{ secrets.FORGEBOX_TOKEN }}
70+
box config set modules.commandbox-semantic-release.plugins='{ "VerifyConditions": "GitHubActionsConditionsVerifier@commandbox-semantic-release", "FetchLastRelease": "ForgeBoxReleaseFetcher@commandbox-semantic-release", "RetrieveCommits": "JGitCommitsRetriever@commandbox-semantic-release", "ParseCommit": "ConventionalChangelogParser@commandbox-semantic-release", "FilterCommits": "DefaultCommitFilterer@commandbox-semantic-release", "AnalyzeCommits": "DefaultCommitAnalyzer@commandbox-semantic-release", "VerifyRelease": "NullReleaseVerifier@commandbox-semantic-release", "GenerateNotes": "GitHubMarkdownNotesGenerator@commandbox-semantic-release", "UpdateChangelog": "FileAppendChangelogUpdater@commandbox-semantic-release", "CommitArtifacts": "NullArtifactsCommitter@commandbox-semantic-release", "PublishRelease": "ForgeBoxReleasePublisher@commandbox-semantic-release", "PublicizeRelease": "GitHubReleasePublicizer@commandbox-semantic-release" }'
71+
72+
- name: Run Semantic Release
73+
env:
74+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75+
run: |
76+
cd modules/sendgrid-sdk
77+
box semantic-release

.github/workflows/tests.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Test Suites
2+
3+
# We are a reusable Workflow only
4+
on: workflow_call
5+
6+
jobs:
7+
tests:
8+
name: Tests
9+
runs-on: ubuntu-20.04
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
cfengine: [ "lucee@5", "adobe@2018", "adobe@2021" ]
14+
steps:
15+
- name: Checkout Repository
16+
uses: actions/checkout@v2
17+
18+
- name: Setup Java
19+
uses: actions/setup-java@v2
20+
with:
21+
distribution: "adopt"
22+
java-version: "11"
23+
24+
- name: Setup CommandBox CLI
25+
uses: Ortus-Solutions/setup-commandbox@main
26+
27+
- name: Cache CommandBox Dependencies
28+
uses: actions/cache@v1
29+
if: ${{ true }}
30+
with:
31+
path: ~/.CommandBox/artifacts
32+
key: ${{ runner.OS }}-commandbox-cache-${{ hashFiles( 'box.json' ) }}-${{ hashFiles( 'box.json' ) }}
33+
restore-keys: |
34+
${{ runner.OS }}-commandbox-cache-${{ hashFiles( 'box.json' ) }}-${{ hashFiles( 'box.json' ) }}
35+
36+
- name: Install Test Harness Dependencies
37+
run: |
38+
box install
39+
40+
- name: Start ${{ matrix.cfengine }} Server
41+
run: |
42+
box server start cfengine=${{ matrix.cfengine }} port=49619 --noSaveSettings --debug
43+
# Install Adobe 2021 cfpm modules
44+
if [[ "${{ matrix.cfengine }}" == "adobe@2021" ]] ; then
45+
box run-script install:2021
46+
fi
47+
curl http://127.0.0.1:49619
48+
49+
- name: Run Tests
50+
run: |
51+
mkdir -p tests/results
52+
box testbox run runner=http://127.0.0.1:49619/tests/runner.cfm --verbose outputFile=tests/results/test-results outputFormats=json,antjunit
53+
54+
- name: Publish Test Results
55+
uses: EnricoMi/publish-unit-test-result-action@v1
56+
if: always()
57+
with:
58+
files: tests/results/**/*.xml
59+
check_name: "${{ matrix.cfengine }} Test Results"
60+
61+
- name: Upload Test Results to Artifacts
62+
if: always()
63+
uses: actions/upload-artifact@v2
64+
with:
65+
name: test-results-${{ matrix.cfengine }}
66+
path: |
67+
tests/results/**/*
68+
69+
- name: Show Server Log On Failures
70+
if: ${{ failure() }}
71+
run: |
72+
box server log
73+
74+
- name: Upload Debug Logs To Artifacts
75+
if: ${{ failure() }}
76+
uses: actions/upload-artifact@v2
77+
with:
78+
name: Failure Debugging Info - ${{ matrix.cfengine }}
79+
path: |
80+
.engine/**/logs/*
81+
.engine/**/WEB-INF/cfusion/logs/*

.module.properties

Lines changed: 0 additions & 3 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 71 deletions
This file was deleted.

box.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
"runner":"http://localhost:49616"
2020
},
2121
"scripts":{
22-
"postVersion":"recipe workbench/bump.boxr"
22+
"postVersion":"recipe workbench/bump.boxr",
23+
"format":"cfformat run modules/sendgrid-sdk/**/*.cfc,tests/resources/**/*.cfc,tests/specs/**/*.cfc --overwrite",
24+
"install:2021":"cfpm install document,feed,zip"
2325
}
2426
}

modules/sendgrid-sdk/ModuleConfig.cfc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ component {
66
this.entrypoint = "/sendgrid";
77

88
function configure() {
9-
routes = [ { pattern = "/webhooks", handler = "webhooks", action = "handle" } ];
9+
routes = [ { pattern: "/webhooks", handler: "webhooks", action: "handle" } ];
1010

1111
interceptorSettings = {
12-
customInterceptionPoints = [
12+
customInterceptionPoints: [
1313
"onSendgridEventProcessed",
1414
"onSendgridEventDropped",
1515
"onSendgridEventDelivered",

0 commit comments

Comments
 (0)