1+ name : Auto test, build and publish
2+ on :
3+ push :
4+ pull_request :
5+ jobs :
6+ javabuild :
7+ name : Java build
8+ runs-on : ubuntu-latest
9+ if : " !contains(github.event.head_commit.message, '[twgit] Init') && github.ref != 'refs/heads/stable'"
10+ steps :
11+ - name : Checkout code
12+ uses : actions/checkout@v4
13+ with :
14+ fetch-depth : 0
15+ - name : Setup Java
16+ uses : actions/setup-java@v5
17+ with :
18+ distribution : ' temurin'
19+ java-version : ' 21'
20+ - name : Maven build
21+ run : |
22+ build/javabuild.sh
23+ - name : Upload Java Artifacts
24+ uses : actions/upload-artifact@v4
25+ with :
26+ name : cfconcurrent-java-artifacts
27+ path : luceelib/*.jar
28+
29+ runtests :
30+ name : Run tests
31+ needs : javabuild
32+ runs-on : ubuntu-latest
33+ if : " !contains(github.event.head_commit.message, '[twgit] Init') && github.ref != 'refs/heads/stable'"
34+ strategy :
35+ fail-fast : false
36+ matrix :
37+ include :
38+ - cfengine : " lucee@5.4"
39+ jdkVersion : " 11"
40+ experimental : false
41+ - cfengine : " lucee@6.2"
42+ jdkVersion : " 21"
43+ experimental : false
44+ - cfengine : " lucee@7.0"
45+ jdkVersion : " 24"
46+ experimental : false
47+ - cfengine : " boxlang@stable"
48+ jdkVersion : " 24"
49+ experimental : true
50+ - cfengine : " adobe@2018"
51+ jdkVersion : " 11"
52+ experimental : false
53+ - cfengine : " adobe@2023"
54+ jdkVersion : " 21"
55+ experimental : false
56+ - cfengine : " adobe@2025"
57+ jdkVersion : " 24"
58+ experimental : false
59+ continue-on-error : ${{ matrix.experimental }}
60+ steps :
61+ - name : Checkout code
62+ uses : actions/checkout@v4
63+ with :
64+ fetch-depth : 0
65+
66+ - name : Download Java Artifacts
67+ uses : actions/download-artifact@v4
68+ with :
69+ name : cfconcurrent-java-artifacts
70+ path : luceelib
71+
72+ - name : Setup Java
73+ uses : actions/setup-java@v4
74+ with :
75+ distribution : " temurin"
76+ java-version : ${{ matrix.jdkVersion }}
77+
78+ - name : Setup CommandBox CLI
79+ uses : Ortus-Solutions/setup-commandbox@v2.0.1
80+
81+ - name : Install dependencies
82+ run : |
83+ cd build/tests && box install --force --verbose
84+
85+ - name : Start ${{ matrix.cfengine }} Server
86+ run : |
87+ # Startup the Server
88+ box server start directory="${GITHUB_WORKSPACE}/build/tests" serverConfigFile="${GITHUB_WORKSPACE}/build/tests/server-cfconcurrenttests.json" cfengine="${{ matrix.cfengine }}" --noSaveSettings --debug
89+ # Test site build up
90+ curl http://127.0.0.1:6789
91+
92+ - name : Run tests
93+ run : |
94+ cd build/tests/
95+ mkdir -p results
96+ exitcode=0
97+ box testbox run --verbose outputFile=results/test-results outputFormats=json,antjunit
98+
99+ - name : Upload Test Results Artifacts
100+ if : always()
101+ uses : actions/upload-artifact@v4
102+ with :
103+ name : cfconcurrent-test-results-${{ matrix.cfengine }}-jdk${{ matrix.jdkVersion }}
104+ path : |
105+ tests/results/*
106+
107+ - name : Publish Test Results
108+ uses : EnricoMi/publish-unit-test-result-action@v2
109+ with :
110+ files : build/tests/results/*.xml
111+
112+ publish :
113+ name : Publish
114+ needs : runtests
115+ runs-on : ubuntu-latest
116+ if : " success() && github.event_name != 'pull_request' && ( startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/heads/release-' ) )"
117+ steps :
118+ - name : Checkout code
119+ uses : actions/checkout@v4
120+ with :
121+ fetch-depth : 0
122+
123+ - name : Download Java Artifacts
124+ uses : actions/download-artifact@v4
125+ with :
126+ name : cfconcurrent-java-artifacts
127+ path : luceelib
128+
129+ - name : Generate release version number
130+ id : versiongen
131+ uses : pixl8/github-action-twgit-release-version-generator@v3
132+
133+ - name : Inject version into box json
134+ if : " env.PUBLISH == 'true'"
135+ uses : dominicwatson/github-action-envsubst@v1
136+ with :
137+ files : box.json
138+ patterns : $VERSION_NUMBER
139+ env :
140+ VERSION_NUMBER : ${{ steps.versiongen.outputs.semver_release_string }}
141+
142+ - name : Zip project
143+ if : " env.PUBLISH == 'true'"
144+
145+ run : zip -rq $ZIP_FILE * --exclude=".*" --exclude="\.git/*" --exclude="\.github/*" --exclude="\build/*""
146+ shell : bash
147+ env :
148+ ZIP_FILE : ${{ steps.versiongen.outputs.semver_release_number }}.zip
149+
150+ - name : Create Release
151+ if : " env.PUBLISH == 'true'"
152+ id : create_release
153+ uses : actions/create-release@v1
154+ env :
155+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
156+ with :
157+ tag_name : ${{ steps.versiongen.outputs.semver_release_string }}
158+ release_name : Release ${{ steps.versiongen.outputs.semver_release_string }}
159+ draft : false
160+ prerelease : ${{ steps.versiongen.outputs.semver_release_is_snapshot }}
161+
162+ - name : Upload Release Asset
163+ if : " env.PUBLISH == 'true'"
164+ id : upload
165+ uses : actions/upload-release-asset@v1
166+ env :
167+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
168+ with :
169+ upload_url : ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
170+ asset_path : ${{ steps.versiongen.outputs.semver_release_number }}.zip
171+ asset_name : ${{ steps.versiongen.outputs.semver_release_number }}.zip
172+ asset_content_type : application/zip
173+
174+ - name : Inject download location
175+ if : " env.PUBLISH == 'true'"
176+ uses : DominicWatson/github-action-envsubst@stable
177+ with :
178+ files : box.json
179+ env :
180+ DOWNLOAD_URL : ${{ steps.upload.outputs.browser_download_url }}
181+
182+ - name : Publish to forgebox
183+ if : " env.PUBLISH == 'true'"
184+ uses : pixl8/github-action-box-publish@v3
185+ with :
186+ forgebox_user : ${{ secrets.FORGEBOX_USER }}
187+ forgebox_pass : ${{ secrets.FORGEBOX_PASS }}
0 commit comments