-
Notifications
You must be signed in to change notification settings - Fork 0
135 lines (128 loc) · 4.47 KB
/
masaCMS.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
name: Run MasaCMS test suite
on:
workflow_dispatch:
inputs:
compile:
required: false
default: false
type: boolean
workflow_call:
jobs:
setup-MasaCMS:
runs-on: ubuntu-latest
steps:
- name: Checkout MasaCMS Repository
uses: actions/checkout@v4
with:
repository: MasaCMS/MasaCMS
- name: Checkout
uses: actions/checkout@v4
with:
path: _custom
- name: Copy custom test runner tweaks
run: |
cp -a _custom/custom/masacms/.CFConfig.json .
cp -R _custom/custom/masacms/core/tests/* core/tests
mkdir plugins
cp _custom/custom/masacms/plugins/* plugins
cp _custom/custom/masacms/config/* config
mkdir core/vendor/testbox
mkdir core/tests/testbox
cd _custom
wget https://downloads.ortussolutions.com/ortussolutions/testbox/2.2.0/testbox-2.2.0.zip
unzip testbox-2.2.0.zip
cp -R testbox/* ../core/vendor/testbox
cp -R testbox/* ../core/tests
ls -l ../core/tests/testbox
rm -rf _custom
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'temurin'
- name: Install the ortus security key
run: curl -fsSl https://downloads.ortussolutions.com/debs/gpg | gpg --dearmor | sudo tee /usr/share/keyrings/ortussolutions.gpg > /dev/null
- name: Add the commandbox source
run: echo "deb [signed-by=/usr/share/keyrings/ortussolutions.gpg] https://downloads.ortussolutions.com/debs/noarch /" | sudo tee /etc/apt/sources.list.d/commandbox.list
- name: Update apt and install commandbox
run: sudo apt-get update && sudo apt-get install apt-transport-https commandbox
- name: Install dependencies
run: box install verbose=true
- name: Store installed webroot for matrix steps
uses: actions/upload-artifact@v4
with:
name: webroot
include-hidden-files: true
path: ${{ github.workspace }}
tests:
runs-on: ubuntu-latest
needs: [ setup-MasaCMS ]
strategy:
fail-fast: false
matrix:
luceeVersion: [ 5.4/snapshot/jar, 6.0/snapshot/jar, 6.1/snapshot/jar, 6.1.0/snapshot/jar, 6.2/snapshot/jar ]
javaVersion: [ 11, 21 ]
exclude:
- luceeVersion: 5.4/snapshot/jar
javaVersion: 21
- luceeVersion: 6.0/snapshot/jar
javaVersion: 21
env:
compile: ${{ github.event.inputs.compile }}
steps:
- name: Restore pre-prepared webroot
uses: actions/download-artifact@v4
with:
name: webroot
path: ${{ github.workspace }}
- name: Set up JDK ${{matrix.javaVersion}}
uses: actions/setup-java@v4
with:
java-version: ${{matrix.javaVersion}}
distribution: 'temurin'
- name: Set up MySQL (local)
run: |
sudo systemctl start mysql
mysql -e 'CREATE DATABASE masacms' -uroot -proot
mysql -e 'CREATE USER "masacms"@"localhost" IDENTIFIED WITH mysql_native_password BY "masacms";' -uroot -proot
mysql -e 'GRANT ALL PRIVILEGES ON masacms.* TO "masacms"@"localhost"' -uroot -proot
cat .CFConfig.json
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: maven-cache
- name: Cache Lucee files
uses: actions/cache@v4
with:
path: /home/runner/work/_actions/lucee/script-runner/main/lucee-download-cache
key: lucee-downloads
- name: Setup MasaCMS database schema
uses: lucee/script-runner@main
with:
webroot: ${{ github.workspace }}/
execute: /core/tests/runner.cfm
luceeVersionQuery: ${{ matrix.luceeVersion }}
compile: ${{env.compile}}
env:
MURA_DBTYPE: mysql
MURA_DBPORT: 3306
MURA_DBHOST: localhost
MURA_DBUSERNAME: masacms
MURA_DBPASSWORD: masacms
MURA_DATABASE: masacms
MURA_DATASOURCE: masacms
- name: Run MasaCMS Test Suite
uses: lucee/script-runner@main
with:
webroot: ${{ github.workspace }}/
execute: /core/tests/runner.cfm
luceeVersionQuery: ${{ matrix.luceeVersion }}
env:
MURA_DBTYPE: mysql
MURA_DBPORT: 3306
MURA_DBHOST: localhost
MURA_DBUSERNAME: masacms
MURA_DBPASSWORD: masacms
MURA_DATABASE: masacms
MURA_DATASOURCE: masacms