-
Notifications
You must be signed in to change notification settings - Fork 12
212 lines (193 loc) · 6.02 KB
/
Copy pathmain.yml
File metadata and controls
212 lines (193 loc) · 6.02 KB
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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
name: Java CI
on:
push:
branches: ['5.6']
pull_request:
workflow_dispatch:
inputs:
deploy:
description: 'Deploy to Maven Central'
type: boolean
default: false
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
outputs:
version: ${{ steps.extract-version.outputs.VERSION }}
steps:
- uses: actions/checkout@v6
- name: Set up JDK 11
uses: actions/setup-java@v5
with:
java-version: '11'
distribution: 'temurin'
- name: Cache Maven packages
uses: actions/cache@v5
with:
path: ~/.m2/repository
key: maven-${{ hashFiles('pom.xml') }}
restore-keys: maven-
- name: Extract version number
id: extract-version
run: |
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Build extension
run: mvn -B -e clean verify
- name: Upload Artifact
uses: actions/upload-artifact@v7
with:
name: orm-lex
path: target/*.lex
test:
runs-on: ubuntu-latest
timeout-minutes: 30
needs: build
strategy:
fail-fast: false
matrix:
include:
- java: '11'
lucee: '6.2/snapshot/light'
- java: '11'
lucee: '7.0/snapshot/light'
- java: '21'
lucee: '6.2/snapshot/light'
- java: '21'
lucee: '7.0/snapshot/light'
- java: '21'
lucee: '7.1/snapshot/light'
- java: '25'
lucee: '7.1/snapshot/light'
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: lucee
MYSQL_USER: lucee
MYSQL_PASSWORD: lucee
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping -h 127.0.0.1"
--health-interval=10s
--health-timeout=5s
--health-retries=5
sql-server:
image: ghcr.io/lucee/mssql-server:test-mirror
env:
MSSQL_PID: Express
ACCEPT_EULA: Y
SA_PASSWORD: Lucee!1433
ports:
- 1433:1433
options: --health-cmd="/opt/mssql-tools18/bin/sqlcmd -C -S localhost -U SA -P ${SA_PASSWORD} -Q 'SELECT 1' || exit 1" --health-interval 10s --health-timeout 5s --health-retries 5
postgres:
image: postgres:15
env:
POSTGRES_DB: lucee
POSTGRES_USER: lucee
POSTGRES_PASSWORD: lucee
ports:
- 5432:5432
options: >-
--health-cmd="pg_isready -U lucee"
--health-interval=10s
--health-timeout=5s
--health-retries=5
steps:
- uses: actions/checkout@v6
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v5
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
- name: Cache Maven packages
uses: actions/cache@v5
with:
path: ~/.m2/repository
key: maven-${{ hashFiles('pom.xml') }}
restore-keys: maven-
- name: Cache Lucee files
uses: actions/cache@v5
with:
path: ~/work/_actions/lucee/script-runner/main/lucee-download-cache
key: lucee-downloads
- name: Download extension artifact
uses: actions/download-artifact@v8
with:
name: orm-lex
path: target
- name: Checkout Lucee
uses: actions/checkout@v6
with:
repository: lucee/lucee
path: lucee
- name: Run Lucee Test Suite
uses: lucee/script-runner@main
with:
webroot: ${{ github.workspace }}/lucee/
execute: /test/bootstrap-tests.cfm
luceeVersion: ${{ matrix.lucee }}
extensionDir: ${{ github.workspace }}/target
env:
testLabels: orm
testAdditional: ${{ github.workspace }}/tests
testServices: mysql,mssql,postgres
MYSQL_SERVER: localhost
MYSQL_USERNAME: lucee
MYSQL_PASSWORD: lucee
MYSQL_PORT: 3306
MYSQL_DATABASE: lucee
MSSQL_SERVER: localhost
MSSQL_USERNAME: sa
MSSQL_PASSWORD: Lucee!1433
MSSQL_PORT: 1433
MSSQL_DATABASE: master
POSTGRES_SERVER: localhost
POSTGRES_USERNAME: lucee
POSTGRES_PASSWORD: lucee
POSTGRES_PORT: 5432
POSTGRES_DATABASE: lucee
deploy:
runs-on: ubuntu-latest
timeout-minutes: 15
needs: [build, test]
if: github.event_name == 'workflow_dispatch' && inputs.deploy && github.ref == 'refs/heads/5.6'
steps:
- uses: actions/checkout@v6
- name: Set up JDK 11
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '11'
- name: Cache Maven packages
uses: actions/cache@v5
with:
path: ~/.m2/repository
key: maven-${{ hashFiles('pom.xml') }}
restore-keys: maven-
- name: Import GPG key
run: |
echo "$GPG_PRIVATE_KEY" | base64 --decode | gpg --batch --import
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
- name: Build and Deploy with Maven
env:
VERSION: ${{ needs.build.outputs.version }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: |
if [[ "$VERSION" == *-SNAPSHOT ]]; then
echo "------- Maven Deploy snapshot -------";
mvn -B -e clean deploy --settings maven-settings.xml
elif [[ "$VERSION" == *-ALPHA ]]; then
echo "------- Maven Install alpha -------";
mvn -B -e clean install --settings maven-settings.xml
else
echo "------- Maven Deploy release -------";
mvn -B -e clean deploy -DperformRelease=true --settings maven-settings.xml
fi