-
-
Notifications
You must be signed in to change notification settings - Fork 5
188 lines (164 loc) · 6.84 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
name: cbwire CI
on:
push:
branches:
- development
- master
env:
MODULE_ID: cbwire
VERSION:
jobs:
#############################################
# Tests First baby! We fail, no build :(
#############################################
tests:
name: Tests
runs-on: ubuntu-latest
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: 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: Setup env.VERSION
run: |
echo "VERSION=`box package version`" >> $GITHUB_ENV
- name: Install Main Dependencies
working-directory: ./
run: |
box install
- 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/*
docs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Setup CommandBox
uses: elpete/[email protected]
- name: Generate Docs
run: |
box install commandbox-docbox --system
box "docbox generate mapping=cbwire excludes=test-harness|ModuleConfig strategy-outputDir=.tmp/apidocs strategy-projectTitle=cbwire"
- name: Setup env.VERSION
run: |
echo "VERSION=`box package version`" >> $GITHUB_ENV
- name: Upload API Docs to S3
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read
env:
AWS_S3_BUCKET: "apidocs.ortussolutions.com"
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ACCESS_SECRET }}
SOURCE_DIR: ".tmp/apidocs"
DEST_DIR: "coldbox-modules/${{ env.MODULE_ID }}/${{ env.VERSION }}"
publish:
name: Simple 'box publish'
needs: tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: Ortus-Solutions/commandbox-action@v1
env:
box_config_endpoints_forgebox_APIToken: ${{ secrets.FORGEBOX_TOKEN }}
with:
cmd: publish --force
# release:
# name: Semantic Release
# if: "!contains(github.event.head_commit.message, '__SEMANTIC RELEASE VERSION UPDATE__')"
# needs: tests
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: Ortus-Solutions/semantic-release-action@v1
# with:
# githubToken: ${{ secrets.GH_TOKEN }}
# excludeCommit: ${{ github.event.head_commit.message }}
# forgeboxToken: ${{ secrets.FORGEBOX_TOKEN }}
# branch: ${{ github.ref_name }}
# plugins: '{ "VerifyConditions": "GitHubActionsConditionsVerifier@commandbox-semantic-release", "FetchLastRelease": "ForgeBoxReleaseFetcher@commandbox-semantic-release", "RetrieveCommits": "JGitCommitsRetriever@commandbox-semantic-release", "ParseCommit": "EmojiLogCommitParser@commandbox-semantic-release", "FilterCommits": "DefaultCommitFilterer@commandbox-semantic-release", "AnalyzeCommits": "EmojiLogCommitAnalyzer@commandbox-semantic-release", "VerifyRelease": "NullReleaseVerifier@commandbox-semantic-release", "GenerateNotes": "GitHubMarkdownNotesGenerator@commandbox-semantic-release", "UpdateChangelog": "FileAppendChangelogUpdater@commandbox-semantic-release", "CommitArtifacts": "GitHubArtifactsCommitter@commandbox-semantic-release", "PublishRelease": "ForgeBoxReleasePublisher@commandbox-semantic-release", "PublicizeRelease": "GitHubReleasePublicizer@commandbox-semantic-release" }'
# - 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: '${{ env.MODULE_ID }} Built with ${{ job.status }}!'
# SLACK_TITLE: "${{ env.MODULE_ID }} Build"
# SLACK_USERNAME: CI
# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}