Skip to content

Commit 0dad302

Browse files
committed
LDEV-6157 update CI: build once, test against Lucee 6.2 and 7.0, gate deploy to master
1 parent e81f35f commit 0dad302

1 file changed

Lines changed: 59 additions & 22 deletions

File tree

.github/workflows/main.yml

Lines changed: 59 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
11
name: Java CI Combined
22

3-
on: [push, pull_request, workflow_dispatch]
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
inputs:
8+
lucee-versions:
9+
description: 'JSON array of Lucee versions to test'
10+
default: '["7.0/snapshot/light","7.0/stable/light","6.2/snapshot/light","6.2/stable/light"]'
11+
dry-run:
12+
description: 'Dry run - skip deploy to Maven'
13+
type: boolean
14+
default: false
415

516
jobs:
617
setup:
718
runs-on: ubuntu-latest
819
outputs:
920
version: ${{ steps.extract-version.outputs.VERSION }}
21+
lucee-matrix: ${{ steps.set-matrix.outputs.matrix }}
1022
steps:
1123
- name: Checkout repository
1224
uses: actions/checkout@v4
@@ -31,6 +43,16 @@ jobs:
3143
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
3244
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
3345
46+
- name: Set Lucee test matrix
47+
id: set-matrix
48+
run: |
49+
DEFAULT='["7.0/snapshot/light","7.0/stable/light","6.2/snapshot/light","6.2/stable/light"]'
50+
MATRIX="${{ inputs.lucee-versions || '' }}"
51+
if [ -z "$MATRIX" ]; then
52+
MATRIX="$DEFAULT"
53+
fi
54+
echo "matrix=$MATRIX" >> $GITHUB_OUTPUT
55+
3456
- name: Cache Lucee files
3557
uses: actions/cache@v4
3658
with:
@@ -43,23 +65,9 @@ jobs:
4365
env:
4466
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
4567

46-
build-and-test:
68+
build:
4769
runs-on: ubuntu-latest
4870
needs: setup
49-
env:
50-
testLabels: image
51-
testAdditional: ${{ github.workspace }}/tests
52-
LUCEE_TEST_VERSIONS_JAKARTA: ${{ vars.LUCEE_TEST_VERSIONS_JAKARTA }}
53-
strategy:
54-
fail-fast: false
55-
matrix:
56-
lucee: ${{ fromJSON(vars.LUCEE_TEST_VERSIONS_JAKARTA) }}
57-
java: [ 11, 21 ]
58-
services:
59-
minio:
60-
image: fclairamb/minio-github-actions
61-
ports:
62-
- 9000:9000
6371
steps:
6472
- uses: actions/checkout@v4
6573

@@ -69,6 +77,14 @@ jobs:
6977
java-version: '11'
7078
distribution: 'adopt'
7179

80+
- name: Cache Maven packages
81+
uses: actions/cache@v4
82+
with:
83+
path: ~/.m2
84+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
85+
restore-keys: |
86+
${{ runner.os }}-maven-
87+
7288
- name: Build and Install with Maven
7389
run: |
7490
echo "------- Maven Install -------";
@@ -77,9 +93,31 @@ jobs:
7793
- name: Upload Artifact
7894
uses: actions/upload-artifact@v4
7995
with:
80-
name: image-lex-${{ matrix.lucee.version }}-${{ matrix.java }}
96+
name: image-lex
8197
path: target/*.lex
8298

99+
test:
100+
runs-on: ubuntu-latest
101+
needs: [setup, build]
102+
strategy:
103+
fail-fast: false
104+
matrix:
105+
lucee: ${{ fromJSON(needs.setup.outputs.lucee-matrix) }}
106+
java: [ 11, 21 ]
107+
services:
108+
minio:
109+
image: fclairamb/minio-github-actions
110+
ports:
111+
- 9000:9000
112+
steps:
113+
- uses: actions/checkout@v4
114+
115+
- name: Download Artifact
116+
uses: actions/download-artifact@v4
117+
with:
118+
name: image-lex
119+
path: target
120+
83121
- name: Checkout Lucee
84122
uses: actions/checkout@v4
85123
with:
@@ -97,8 +135,7 @@ jobs:
97135
with:
98136
webroot: ${{ github.workspace }}/lucee/test
99137
execute: /bootstrap-tests.cfm
100-
luceeVersion: ${{ matrix.lucee.version }}
101-
luceeVersionQuery: ${{ matrix.lucee.query }}
138+
luceeVersion: ${{ matrix.lucee }}
102139
extensionDir: ${{ github.workspace }}/target
103140
env:
104141
testLabels: image
@@ -108,8 +145,8 @@ jobs:
108145

109146
deploy:
110147
runs-on: ubuntu-latest
111-
needs: [setup, build-and-test]
112-
if: always() && needs.build-and-test.result == 'success'
148+
needs: [setup, test]
149+
if: always() && needs.test.result == 'success' && github.ref == 'refs/heads/master' && !inputs.dry-run
113150
steps:
114151
- name: Checkout repository
115152
uses: actions/checkout@v4
@@ -146,4 +183,4 @@ jobs:
146183
else
147184
echo "------- Maven Deploy release on ${{ github.event_name }} -------";
148185
mvn -B -e -f pom.xml clean deploy -DperformRelease=true --settings maven-settings.xml
149-
fi
186+
fi

0 commit comments

Comments
 (0)