11name : 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
516jobs :
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
12- uses : actions/checkout@v4
24+ uses : actions/checkout@v6
1325
1426 - name : Set up JDK 11
15- uses : actions/setup-java@v4
27+ uses : actions/setup-java@v5
1628 with :
1729 distribution : ' temurin'
1830 java-version : ' 11'
1931
2032 - name : Cache Maven packages
21- uses : actions/cache@v4
33+ uses : actions/cache@v5
2234 with :
2335 path : ~/.m2
2436 key : ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
@@ -29,10 +41,20 @@ jobs:
2941 id : extract-version
3042 run : |
3143 VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
32- echo "::set-output name=VERSION::$VERSION"
44+ echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
45+
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
3355
3456 - name : Cache Lucee files
35- uses : actions/cache@v4
57+ uses : actions/cache@v5
3658 with :
3759 path : ~/work/_actions/lucee/script-runner/main/lucee-download-cache
3860 key : lucee-downloads
@@ -43,68 +65,92 @@ jobs:
4365 env :
4466 GPG_PRIVATE_KEY : ${{ secrets.GPG_PRIVATE_KEY }}
4567
46- build-and-test :
68+ build :
4769 runs-on : ubuntu-latest
48- needs : setup
49- env :
50- LUCEE_TEST_VERSIONS_JAKARTA : ${{ vars.LUCEE_TEST_VERSIONS_JAKARTA }}
51- strategy :
52- matrix :
53- lucee : ${{ fromJSON(vars.LUCEE_TEST_VERSIONS_JAKARTA) }}
5470 steps :
55- - uses : actions/checkout@v4
71+ - uses : actions/checkout@v6
5672
5773 - name : Set up JDK 11
58- uses : actions/setup-java@v4
74+ uses : actions/setup-java@v5
5975 with :
6076 java-version : ' 11'
6177 distribution : ' adopt'
6278
79+ - name : Cache Maven packages
80+ uses : actions/cache@v5
81+ with :
82+ path : ~/.m2
83+ key : ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
84+ restore-keys : |
85+ ${{ runner.os }}-maven-
86+
6387 - name : Build and Install with Maven
6488 run : |
6589 echo "------- Maven Install -------";
6690 mvn -B -e -f pom.xml clean install
6791
6892 - name : Upload Artifact
69- uses : actions/upload-artifact@v4
93+ uses : actions/upload-artifact@v7
7094 with :
71- name : websocketclient-lex-${{ matrix.lucee.version }}
95+ name : websocketclient-lex
7296 path : target/*.lex
7397
98+ test :
99+ runs-on : ubuntu-latest
100+ needs : [setup, build]
101+ strategy :
102+ fail-fast : false
103+ matrix :
104+ lucee : ${{ fromJSON(needs.setup.outputs.lucee-matrix) }}
105+ java : [ 11, 21 ]
106+ steps :
107+ - uses : actions/checkout@v6
108+
109+ - name : Download Artifact
110+ uses : actions/download-artifact@v8
111+ with :
112+ name : websocketclient-lex
113+ path : target
114+
74115 - name : Checkout Lucee
75- uses : actions/checkout@v4
116+ uses : actions/checkout@v6
76117 with :
77118 repository : lucee/lucee
78119 path : lucee
79120
121+ - name : Set up JDK ${{ matrix.java }}
122+ uses : actions/setup-java@v5
123+ with :
124+ java-version : ${{ matrix.java }}
125+ distribution : ' adopt'
126+
80127 - name : Run Lucee Test Suite
81128 uses : lucee/script-runner@main
82129 with :
83130 webroot : ${{ github.workspace }}/lucee/test
84131 execute : /bootstrap-tests.cfm
85- luceeVersion : ${{ matrix.lucee.version }}
86- luceeVersionQuery : ${{ matrix.lucee.query }}
132+ luceeVersion : ${{ matrix.lucee }}
87133 extensionDir : ${{ github.workspace }}/target
88134 env :
89135 testLabels : websocketclient
90136 testAdditional : ${{ github.workspace }}/tests
91137
92138 deploy :
93139 runs-on : ubuntu-latest
94- needs : [build-and- test]
95- if : always() && needs.build-and- test.result == 'success'
140+ needs : [setup, test]
141+ if : always() && needs.test.result == 'success' && github.ref == 'refs/heads/master' && !inputs.dry-run
96142 steps :
97143 - name : Checkout repository
98- uses : actions/checkout@v4
144+ uses : actions/checkout@v6
99145
100146 - name : Set up JDK 11
101- uses : actions/setup-java@v4
147+ uses : actions/setup-java@v5
102148 with :
103149 distribution : ' temurin'
104150 java-version : ' 11'
105151
106152 - name : Cache Maven packages
107- uses : actions/cache@v4
153+ uses : actions/cache@v5
108154 with :
109155 path : ~/.m2
110156 key : ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
0 commit comments