-
-
Notifications
You must be signed in to change notification settings - Fork 3
123 lines (108 loc) · 4.04 KB
/
tests.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
name: Test Suites
# We are a reusable Workflow only
on:
workflow_call:
secrets:
SLACK_WEBHOOK_URL:
required: true
jobs:
tests:
name: Tests
runs-on: ubuntu-20.04
env:
ELASTICSEARCH_PROTOCOL: http
ELASTICSEARCH_HOST: 127.0.0.1
ELASTICSEARCH_PORT: 9200
LOGSTASH_API_URL: http://localhost:60299/logstash/api/logs
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
cfengine: [ "lucee@5", "adobe@2018", "adobe@2021", "adobe@2023" ]
coldboxVersion: [ "^6", "^7" ]
ELASTICSEARCH_VERSION: [ "7.17.10", "8.8.1" ]
experimental: [ false ]
include:
- cfengine: "lucee@6"
coldboxVersion: "^7"
ELASTICSEARCH_VERSION: "8.8.1"
experimental: true
steps:
- name: Checkout Repository
uses: actions/[email protected]
- name: Setup Java
uses: actions/[email protected]
with:
distribution: "temurin"
java-version: "11"
- name: Setup CommandBox CLI
uses: Ortus-Solutions/[email protected]
- name: Install Dependencies
run: |
box run-script harness:install
- name: Install Node 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Compile Release Static assets
run: |
npm install && npm run prod
cd $GITHUB_WORKSPACE
- name: Setup Elasticsearch
run: |
docker run -d -p "${{ env.ELASTICSEARCH_PORT }}:9200" -v $PWD/build/resources/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml elasticsearch:${{ matrix.ELASTICSEARCH_VERSION }}
rm -rf test-harness/modules_app
- name: Start ${{ matrix.cfengine }} Server
env:
ENVIRONMENT: development
run: |
cd test-harness && box install --force coldbox@${{ matrix.coldboxVersion }} && cd ../
box server start serverConfigFile="server-${{ matrix.cfengine }}.json" --noSaveSettings --debug
cd ../
curl http://127.0.0.1:60299
- name: Run Tests
env:
ENVIRONMENT: development
run: |
mkdir -p test-harness/tests/results
box package set testbox.runner="http://127.0.0.1:60299/tests/runner.cfm?seed=true"
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@v2
if: always()
with:
junit_files: test-harness/tests/results/**/*.xml
check_name: "${{ matrix.cfengine }} Test Results"
- name: Upload Test Results to Artifacts
if: always()
uses: actions/[email protected]
with:
name: test-results-${{ matrix.cfengine }}
path: |
test-harness/tests/results/**/*
- name: Failure Debugging Log
if: ${{ failure() }}
run: |
cd test-harness
box server log serverConfigFile="server-${{ matrix.cfengine }}.json"
cd ../
- name: Upload Debugging Log To Artifacts
if: ${{ failure() }}
uses: actions/[email protected]
with:
name: Failure Debugging Info - ${{ matrix.cfengine }}
path: |
test-harness/.engine/**/logs/*
test-harness/.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 }}