jfx
Зеркало из https://github.com/openjdk/jfx
1#
2# Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# This code is free software; you can redistribute it and/or modify it
6# under the terms of the GNU General Public License version 2 only, as
7# published by the Free Software Foundation. Oracle designates this
8# particular file as subject to the "Classpath" exception as provided
9# by Oracle in the LICENSE file that accompanied this code.
10#
11# This code is distributed in the hope that it will be useful, but WITHOUT
12# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14# version 2 for more details (a copy is included in the LICENSE file that
15# accompanied this code).
16#
17# You should have received a copy of the GNU General Public License version
18# 2 along with this work; if not, write to the Free Software Foundation,
19# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20#
21# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22# or visit www.oracle.com if you need additional information or have any
23# questions.
24#
25
26#
27# This GitHub actions YAML file runs a build and test on each of the three primary platforms:
28# Linux, macOS (both x64 and aarch64), Windows. The jobs are run using the default (latest) OS platform for each OS.
29# We download a specific version the boot JDK and gradle. We use the default versions
30# of all other build tools (e.g., compilers and ant) that are available on each platform.
31#
32# The build step is run in the default mode without building the native media or webkit libraries.
33# The test is run with web tests excluded. As a follow-up enhancement, we might consider optionally
34# building the media and webkit libraries.
35#
36# NOTE: much of the build logic is duplicated for each platform. Keep this in mind when making changes.
37#
38
39name: JavaFX pre-submit tests
40
41on:
42# Run GitHub actions on every push to all branches except the main production branches, also
43# exclude any branch starting with "WIP".
44push:
45branches-ignore:
46- master
47- main
48- 'jfx[0-9]+'
49- 'WIP*'
50# Enable triggering the workflow manually
51workflow_dispatch:
52
53permissions:
54contents: read
55
56jobs:
57validation:
58name: "Gradle Wrapper Validation"
59runs-on: ubuntu-latest
60steps:
61- uses: actions/checkout@v2
62- uses: gradle/wrapper-validation-action@v1
63
64
65linux_x64_build:
66name: Linux x64
67needs: validation
68runs-on: "ubuntu-24.04"
69
70env:
71# FIXME: read this information from a property file
72# BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}"
73# BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_FILENAME }}"
74# BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_URL }}"
75# BOOT_JDK_SHA256: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_SHA256 }}"
76BOOT_JDK_VERSION: "23"
77BOOT_JDK_FILENAME: "jdk-23_linux-x64_bin.tar.gz"
78BOOT_JDK_URL: "https://download.oracle.com/java/23/archive/jdk-23_linux-x64_bin.tar.gz"
79ANT_DIR: "apache-ant-1.10.5"
80ANT_FILENAME: "apache-ant-1.10.5.tar.gz"
81ANT_URL: "https://archive.apache.org/dist/ant/binaries/apache-ant-1.10.5-bin.tar.gz"
82
83steps:
84- name: Checkout the source
85uses: actions/checkout@v2
86with:
87path: jfx
88
89- name: Install dependencies
90run: |
91set -x
92sudo apt-get update
93sudo apt-get install libgl1-mesa-dev libx11-dev libxxf86vm-dev libxt-dev pkg-config libgtk2.0-dev libgtk-3-dev libxtst-dev gcc-13 g++-13
94sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 100 --slave /usr/bin/g++ g++ /usr/bin/g++-13
95mkdir -p "${HOME}/build-tools"
96wget -O "${HOME}/build-tools/${ANT_FILENAME}" "${ANT_URL}"
97tar -zxf "${HOME}/build-tools/${ANT_FILENAME}" -C "${HOME}/build-tools"
98
99# FIXME: enable cache for boot JDK
100# - name: Restore boot JDK from cache
101# id: bootjdk
102# uses: actions/cache@v2
103# with:
104# path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }}
105# key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1
106
107- name: Download boot JDK
108run: |
109set -x
110mkdir -p "${HOME}/bootjdk"
111wget -O "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" "${BOOT_JDK_URL}"
112# FIXME: sha256sum
113tar -xf "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" -C "${HOME}/bootjdk"
114# FIXME: enable cache for boot JDK
115
116- name: Setup environment
117run: |
118set -x
119export JAVA_HOME="${HOME}/bootjdk/jdk-${BOOT_JDK_VERSION}"
120echo "JAVA_HOME=${JAVA_HOME}" >> "${GITHUB_ENV}"
121export ANT_HOME="${HOME}/build-tools/${ANT_DIR}"
122echo "ANT_HOME=${ANT_HOME}" >> "${GITHUB_ENV}"
123export PATH="$JAVA_HOME/bin:$ANT_HOME/bin:$PATH"
124env | sort
125which java
126java -version
127which ant
128ant -version
129gcc -v
130
131- name: Build JavaFX artifacts
132working-directory: jfx
133run: |
134set -x
135export PATH="$JAVA_HOME/bin:$ANT_HOME/bin:$PATH"
136bash gradlew -version
137bash gradlew --info all
138
139- name: Run JavaFX headless tests
140working-directory: jfx
141run: |
142set -x
143export PATH="$JAVA_HOME/bin:$ANT_HOME/bin:$PATH"
144bash gradlew --info --continue -PTEST_ONLY=true test -x :web:test
145
146
147macos_x64_build:
148name: macOS x64
149needs: validation
150runs-on: "macos-13"
151
152env:
153# FIXME: read this information from a property file
154# BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}"
155# BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_FILENAME }}"
156# BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_URL }}"
157# BOOT_JDK_SHA256: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_SHA256 }}"
158BOOT_JDK_VERSION: "23"
159BOOT_JDK_FILENAME: "jdk-23_macos-x64_bin.tar.gz"
160BOOT_JDK_URL: "https://download.oracle.com/java/23/archive/jdk-23_macos-x64_bin.tar.gz"
161# Disabled due to timeout downloading ant; use ant installed on system
162#ANT_DIR: "apache-ant-1.10.5"
163#ANT_FILENAME: "apache-ant-1.10.5.tar.gz"
164#ANT_URL: "https://archive.apache.org/dist/ant/binaries/apache-ant-1.10.5-bin.tar.gz"
165
166steps:
167- name: Checkout the source
168uses: actions/checkout@v2
169with:
170path: jfx
171
172- name: Install dependencies
173run: |
174set -x
175echo "NOT NEEDED: brew install make"
176echo "NOT NEEDED: wget ... ant"
177#mkdir -p "${HOME}/build-tools"
178#wget -O "${HOME}/build-tools/${ANT_FILENAME}" "${ANT_URL}"
179#tar -zxf "${HOME}/build-tools/${ANT_FILENAME}" -C "${HOME}/build-tools"
180
181# FIXME: enable cache for boot JDK
182# - name: Restore boot JDK from cache
183# id: bootjdk
184# uses: actions/cache@v2
185# with:
186# path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }}
187# key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1
188
189- name: Download boot JDK
190run: |
191set -x
192mkdir -p "${HOME}/bootjdk"
193wget -O "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" "${BOOT_JDK_URL}"
194# FIXME: sha256sum
195tar -xf "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" -C "${HOME}/bootjdk"
196# FIXME: enable cache for boot JDK
197
198- name: Setup environment
199run: |
200set -x
201export JAVA_HOME="${HOME}/bootjdk/jdk-${BOOT_JDK_VERSION}.jdk/Contents/Home"
202echo "JAVA_HOME=${JAVA_HOME}" >> "${GITHUB_ENV}"
203#export ANT_HOME="${HOME}/build-tools/${ANT_DIR}"
204#echo "ANT_HOME=${ANT_HOME}" >> "${GITHUB_ENV}"
205#export PATH="$JAVA_HOME/bin:$ANT_HOME/bin:$PATH"
206export PATH="$JAVA_HOME/bin:$PATH"
207env | sort
208which java
209java -version
210which ant
211ant -version
212sudo xcode-select --switch /Applications/Xcode_14.3.1.app/Contents/Developer
213xcodebuild -version
214
215- name: Build JavaFX artifacts
216working-directory: jfx
217run: |
218set -x
219#export PATH="$JAVA_HOME/bin:$ANT_HOME/bin:$PATH"
220export PATH="$JAVA_HOME/bin:$PATH"
221bash gradlew -version
222bash gradlew --info all
223
224- name: Run JavaFX headless tests
225working-directory: jfx
226run: |
227set -x
228#export PATH="$JAVA_HOME/bin:$ANT_HOME/bin:$PATH"
229export PATH="$JAVA_HOME/bin:$PATH"
230bash gradlew --info --continue -PTEST_ONLY=true test -x :web:test
231
232
233macos_aarch64_build:
234name: macOS aarch64
235needs: validation
236runs-on: "macos-14"
237
238env:
239# FIXME: read this information from a property file
240# BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}"
241# BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_FILENAME }}"
242# BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_URL }}"
243# BOOT_JDK_SHA256: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_SHA256 }}"
244BOOT_JDK_VERSION: "23"
245BOOT_JDK_FILENAME: "jdk-23_macos-aarch64_bin.tar.gz"
246BOOT_JDK_URL: "https://download.oracle.com/java/23/archive/jdk-23_macos-aarch64_bin.tar.gz"
247# Disabled due to timeout downloading ant; use ant installed on system
248#ANT_DIR: "apache-ant-1.10.5"
249#ANT_FILENAME: "apache-ant-1.10.5.tar.gz"
250#ANT_URL: "https://archive.apache.org/dist/ant/binaries/apache-ant-1.10.5-bin.tar.gz"
251
252steps:
253- name: Checkout the source
254uses: actions/checkout@v2
255with:
256path: jfx
257
258- name: Install dependencies
259run: |
260set -x
261echo "NOT NEEDED: brew install make"
262echo "NOT NEEDED: wget ... ant"
263#mkdir -p "${HOME}/build-tools"
264#wget -O "${HOME}/build-tools/${ANT_FILENAME}" "${ANT_URL}"
265#tar -zxf "${HOME}/build-tools/${ANT_FILENAME}" -C "${HOME}/build-tools"
266
267# FIXME: enable cache for boot JDK
268# - name: Restore boot JDK from cache
269# id: bootjdk
270# uses: actions/cache@v2
271# with:
272# path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }}
273# key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1
274
275- name: Download boot JDK
276run: |
277set -x
278mkdir -p "${HOME}/bootjdk"
279wget -O "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" "${BOOT_JDK_URL}"
280# FIXME: sha256sum
281tar -xf "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" -C "${HOME}/bootjdk"
282# FIXME: enable cache for boot JDK
283
284- name: Setup environment
285run: |
286set -x
287export JAVA_HOME="${HOME}/bootjdk/jdk-${BOOT_JDK_VERSION}.jdk/Contents/Home"
288echo "JAVA_HOME=${JAVA_HOME}" >> "${GITHUB_ENV}"
289#export ANT_HOME="${HOME}/build-tools/${ANT_DIR}"
290#echo "ANT_HOME=${ANT_HOME}" >> "${GITHUB_ENV}"
291#export PATH="$JAVA_HOME/bin:$ANT_HOME/bin:$PATH"
292export PATH="$JAVA_HOME/bin:$PATH"
293env | sort
294which java
295java -version
296which ant
297ant -version
298sudo xcode-select --switch /Applications/Xcode_14.3.1.app/Contents/Developer
299xcodebuild -version
300
301- name: Build JavaFX artifacts
302working-directory: jfx
303run: |
304set -x
305#export PATH="$JAVA_HOME/bin:$ANT_HOME/bin:$PATH"
306export PATH="$JAVA_HOME/bin:$PATH"
307bash gradlew -version
308bash gradlew --info all
309
310- name: Run JavaFX headless tests
311working-directory: jfx
312run: |
313set -x
314#export PATH="$JAVA_HOME/bin:$ANT_HOME/bin:$PATH"
315export PATH="$JAVA_HOME/bin:$PATH"
316bash gradlew --info --continue -PTEST_ONLY=true test -x :web:test
317
318
319windows_x64_build:
320name: Windows x64
321needs: validation
322runs-on: "windows-2022"
323
324env:
325# FIXME: read this information from a property file
326# BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}"
327# BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_FILENAME }}"
328# BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_URL }}"
329# BOOT_JDK_SHA256: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_SHA256 }}"
330BOOT_JDK_VERSION: "23"
331BOOT_JDK_FILENAME: "jdk-23_windows-x64_bin.zip"
332BOOT_JDK_URL: "https://download.oracle.com/java/23/archive/jdk-23_windows-x64_bin.zip"
333ANT_DIR: "apache-ant-1.10.5"
334ANT_FILENAME: "apache-ant-1.10.5.tar.gz"
335ANT_URL: "https://archive.apache.org/dist/ant/binaries/apache-ant-1.10.5-bin.tar.gz"
336
337steps:
338- name: Checkout the source
339uses: actions/checkout@v2
340with:
341path: jfx
342
343# FIXME: enable cache for boot JDK
344# - name: Restore boot JDK from cache
345# id: bootjdk
346# uses: actions/cache@v2
347# with:
348# path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }}
349# key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1
350
351- name: Download boot JDK
352run: |
353mkdir -p "$HOME\bootjdk"
354& curl -L "$env:BOOT_JDK_URL" -o "$HOME/bootjdk/$env:BOOT_JDK_FILENAME"
355# FIXME: sha256sum
356tar -xf "$HOME/bootjdk/$env:BOOT_JDK_FILENAME" -C "$HOME/bootjdk"
357# FIXME: enable cache for boot JDK
358
359- name: Restore cygwin packages from cache
360id: cygwin
361uses: actions/cache@v2
362with:
363path: ~/cygwin/packages
364key: cygwin-packages-${{ runner.os }}-v1
365
366- name: Install cygwin
367run: |
368New-Item -Force -ItemType directory -Path "$HOME\cygwin"
369& curl -L "https://www.cygwin.com/setup-x86_64.exe" -o "$HOME/cygwin/setup-x86_64.exe"
370Start-Process -FilePath "$HOME\cygwin\setup-x86_64.exe" -ArgumentList "--quiet-mode --packages make,zip,unzip --root $HOME\cygwin\cygwin64 --local-package-dir $HOME\cygwin\packages --site http://mirrors.kernel.org/sourceware/cygwin --no-desktop --no-shortcuts --no-startmenu --no-admin" -Wait -NoNewWindow
371
372- name: Install dependencies
373run: |
374mkdir -p "$HOME\build-tools"
375& curl -L "$env:ANT_URL" -o "$HOME/build-tools/$env:ANT_FILENAME"
376tar -zxf "$HOME/build-tools/$env:ANT_FILENAME" -C "$HOME/build-tools"
377
378- name: Setup environment
379run: |
380echo "dir ...\VC\Tools\MSVC"
381dir "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC"
382# echo "dir ...\VC\Tools\MSVC"
383# dir "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC"
384
385$env:Path = "$HOME\cygwin\cygwin64\bin;$HOME\cygwin\cygwin64\bin;$env:Path" ;
386$env:JAVA_HOME = "$HOME\bootjdk\jdk-$env:BOOT_JDK_VERSION" ;
387echo "JAVA_HOME=$env:JAVA_HOME"
388$env:ANT_HOME = "${HOME}\build-tools\$env:ANT_DIR"
389echo "ANT_HOME=$env:ANT_HOME"
390$env:Path = "$env:JAVA_HOME\bin;$env:ANT_HOME\bin;$env:Path" ;
391echo "Path=$env:Path"
392which java
393java -version
394which ant
395ant -version
396
397# Save JAVA_HOME, ANT_HOME, and Path (renamed to THE_PATH) in env variables
398echo "JAVA_HOME=$env:JAVA_HOME" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
399echo "ANT_HOME=$env:ANT_HOME" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
400echo "THE_PATH=$env:Path" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
401
402- name: Build JavaFX artifacts
403working-directory: jfx
404run: |
405echo "JAVA_HOME=$env:JAVA_HOME"
406echo "ANT_HOME=$env:ANT_HOME"
407$env:Path = "$env:THE_PATH" ;
408echo "Path=$env:Path"
409which java
410java -version
411.\gradlew.bat -version
412.\gradlew.bat --info all
413
414- name: Run JavaFX headless tests
415working-directory: jfx
416run: |
417echo "JAVA_HOME=$env:JAVA_HOME"
418echo "ANT_HOME=$env:ANT_HOME"
419$env:Path = "$env:THE_PATH" ;
420echo "Path=$env:Path"
421.\gradlew.bat --info --continue -PTEST_ONLY=true test -x :web:test
422