@@ -16,34 +16,57 @@ concurrency:
1616 group : ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1717 cancel-in-progress : true
1818
19+ defaults :
20+ run :
21+ shell : bash
22+
23+ env :
24+ java_version : 11
25+ java_distribution : zulu
26+ groovy_version : 4.0.3
27+
1928jobs :
2029
30+ # build
31+ # ############################################################################
32+
2133 build :
2234 strategy :
2335 fail-fast : true
2436 matrix :
2537 runner :
2638 - ubuntu-latest
2739 - macos-latest
28- outputs :
29- default_runner : ubuntu-latest
3040 runs-on : ${{ matrix.runner }}
3141 steps :
32- - uses : actions/checkout@v3
42+ - uses : actions/checkout@v4
3343 - name : Set up JDK
34- uses : actions/setup-java@v3
44+ uses : actions/setup-java@v4
3545 with :
36- java-version : 11
37- distribution : zulu
46+ java-version : ${{ env.java_version }}
47+ distribution : ${{ env.java_distribution }}
3848 - name : build
39- run : ./build-coatjava.sh --spotbugs --unittests --quiet
49+ run : ./build-coatjava.sh --spotbugs --unittests --quiet -T4
4050 - name : tar # tarball to preserve permissions
4151 run : tar czvf coatjava.tar.gz coatjava
42- - uses : actions/upload-artifact@v3
52+ - uses : actions/upload-artifact@v4
4353 with :
4454 name : build_${{ matrix.runner }}
4555 retention-days : 1
4656 path : coatjava.tar.gz
57+ - name : collect jacoco report
58+ if : ${{ matrix.runner == 'ubuntu-latest' }}
59+ run : validation/jacoco-aggregate.sh
60+ - name : publish jacoco report
61+ if : ${{ matrix.runner == 'ubuntu-latest' }}
62+ uses : actions/upload-artifact@v4
63+ with :
64+ name : jacoco_report
65+ path : publish/
66+ retention-days : 1
67+
68+ # tests
69+ # ############################################################################
4770
4871 test_coatjava :
4972 needs : [ build ]
@@ -71,13 +94,13 @@ jobs:
7194 - { runner: macos-latest, id: eb-ep, cmd: ./run-eb-tests.sh -100 electronproton }
7295 runs-on : ${{ matrix.runner }}
7396 steps :
74- - uses : actions/checkout@v3
97+ - uses : actions/checkout@v4
7598 - name : Set up JDK
76- uses : actions/setup-java@v3
99+ uses : actions/setup-java@v4
77100 with :
78- java-version : 11
79- distribution : zulu
80- - uses : actions/download-artifact@v3
101+ java-version : ${{ env.java_version }}
102+ distribution : ${{ env.java_distribution }}
103+ - uses : actions/download-artifact@v4
81104 with :
82105 name : build_${{ matrix.runner }}
83106 - name : untar build
@@ -90,21 +113,21 @@ jobs:
90113
91114 test_run-groovy :
92115 needs : [ build ]
93- runs-on : ${{ needs.build.outputs.default_runner }}
116+ runs-on : ubuntu-latest
94117 steps :
95- - uses : actions/checkout@v3
118+ - uses : actions/checkout@v4
96119 - name : Set up JDK
97- uses : actions/setup-java@v3
120+ uses : actions/setup-java@v4
98121 with :
99- java-version : 11
100- distribution : zulu
122+ java-version : ${{ env.java_version }}
123+ distribution : ${{ env.java_distribution }}
101124 - name : setup groovy
102- uses : wtfjoke/setup-groovy@v1
125+ uses : wtfjoke/setup-groovy@v2
103126 with :
104- groovy-version : 4.x
105- - uses : actions/download-artifact@v3
127+ groovy-version : ${{ env.groovy_version }}
128+ - uses : actions/download-artifact@v4
106129 with :
107- name : build_${{ needs.build.outputs.default_runner }}
130+ name : build_ubuntu-latest
108131 - name : untar build
109132 run : tar xzvf coatjava.tar.gz
110133 - name : test run-groovy
@@ -115,7 +138,68 @@ jobs:
115138 - build
116139 - test_coatjava
117140 - test_run-groovy
118- runs-on : ${{ needs.build.outputs.default_runner }}
141+ runs-on : ubuntu-latest
119142 steps :
120143 - name : pass
121144 run : exit 0
145+
146+ # generate documentation
147+ # ############################################################################
148+
149+ generate_documentation :
150+ runs-on : ubuntu-latest
151+ steps :
152+ - uses : actions/checkout@v4
153+ - name : Set up JDK
154+ uses : actions/setup-java@v4
155+ with :
156+ java-version : ${{ env.java_version }}
157+ distribution : ${{ env.java_distribution }}
158+ - name : build
159+ run : ./build-coatjava.sh
160+ - name : generate documentation
161+ run : ./build-javadocs.sh
162+ - uses : actions/upload-artifact@v4
163+ with :
164+ name : javadoc
165+ path : docs/javadoc/
166+ retention-days : 1
167+
168+ # deploy web pages
169+ # ############################################################################
170+
171+ collect_webpages :
172+ if : ${{ github.ref == 'refs/heads/development' }}
173+ needs : [ build, generate_documentation ]
174+ runs-on : ubuntu-latest
175+ steps :
176+ - name : download jacoco report
177+ uses : actions/download-artifact@v4
178+ with :
179+ name : jacoco_report
180+ path : pages/jacoco
181+ - name : download javadoc documentation
182+ uses : actions/download-artifact@v4
183+ with :
184+ name : javadoc
185+ path : pages/javadoc
186+ - run : tree pages
187+ - uses : actions/upload-pages-artifact@v3
188+ with :
189+ retention-days : 1
190+ path : pages/
191+
192+ deploy_web_pages :
193+ if : ${{ github.ref == 'refs/heads/development' }}
194+ needs : collect_webpages
195+ permissions :
196+ pages : write
197+ id-token : write
198+ environment :
199+ name : github-pages
200+ url : ${{ steps.deployment.outputs.page_url }}
201+ runs-on : ubuntu-latest
202+ steps :
203+ - name : deployment
204+ id : deployment
205+ uses : actions/deploy-pages@v4
0 commit comments