Skip to content

Commit a64d356

Browse files
authored
feat: enable firefox arm64 build with cypress/factory (#1307)
add firefox arm circleci tests
1 parent e25d80b commit a64d356

File tree

5 files changed

+40
-10
lines changed

5 files changed

+40
-10
lines changed

circle.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,11 @@ workflows:
255255
parameters:
256256
test-target: [
257257
test-factory-electron,
258+
test-factory-firefox,
258259
test-factory-cypress-included-electron,
259260
test-factory-cypress-included-electron-non-root-user,
261+
test-factory-cypress-included-firefox,
262+
test-factory-cypress-included-firefox-non-root-user,
260263
test-factory-all-included-electron-only
261264
]
262265
resourceClass: [arm.medium]
@@ -317,7 +320,8 @@ workflows:
317320
alias: browsers-arm
318321
parameters:
319322
test-target: [
320-
test-browsers-electron
323+
test-browsers-electron,
324+
test-browsers-firefox
321325
]
322326
resourceClass: [arm.medium]
323327
target: [browsers]
@@ -338,7 +342,8 @@ workflows:
338342
alias: included-arm
339343
parameters:
340344
test-target: [
341-
test-included-electron
345+
test-included-electron,
346+
test-included-firefox
342347
]
343348
resourceClass: [arm.medium]
344349
target: [included]

factory/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ NODE_VERSION="${FACTORY_DEFAULT_NODE_VERSION}"
1818

1919
# Update the FACTORY_VERSION to deploy cypress/factory if you make changes to
2020
# BASE_IMAGE, FACTORY_DEFAULT_NODE_VERSION, YARN_VERSION, factory.Dockerfile or installScripts
21-
FACTORY_VERSION='5.4.0'
21+
FACTORY_VERSION='5.5.0'
2222

2323
# Chrome versions: https://www.ubuntuupdates.org/package/google_chrome/stable/main/base/google-chrome-stable
2424
CHROME_VERSION='134.0.6998.88-1'

factory/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change log
22

3+
## 5.5.0
4+
5+
- Add factory support for Firefox `arm64` with versions `136.0` and above. Addresses [#1306](https://github.com/cypress-io/cypress-docker-images/issues/1306).
6+
37
## 5.4.0
48

59
- Add support for HTTP_PROXY when building a `cypress/factory` based image. Addressed in [#1276](https://github.com/cypress-io/cypress-docker-images/pull/1276).
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
#! /bin/bash
22

33
# Firefox does not have a debian package that is kept up to date, so instead we install deps directly and download the tar to unzip.
4+
#
5+
# $1: version (example: 136.0)
6+
# $2: compression (xz or bz2)
7+
# $3: platform (linux-x86_64 or linux-aarch64)
8+
49
apt-get update \
510
&& apt-get install -y \
611
libxtst6 \
712
libgtk-3-0 \
813
libdbus-glib-1-2 \
914
mplayer \
1015
xz-utils \
11-
&& wget --no-verbose -O /tmp/firefox.tar.${2} https://download-installer.cdn.mozilla.net/pub/firefox/releases/${1}/linux-x86_64/en-US/firefox-${1}.tar.${2} \
16+
&& wget --no-verbose -O /tmp/firefox.tar.${2} https://download-installer.cdn.mozilla.net/pub/firefox/releases/${1}/${3}/en-US/firefox-${1}.tar.${2} \
1217
&& tar -C /opt -xaf /tmp/firefox.tar.${2} \
1318
&& rm /tmp/firefox.tar.${2} \
1419
&& ln -fs /opt/firefox/firefox /usr/bin/firefox \

factory/installScripts/firefox/install-firefox-version.js

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,29 @@ if (!firefoxVersion) {
88
return
99
}
1010

11-
if (process.arch !== 'x64') {
12-
console.log('Not downloading Firefox since we are not on x64. For arm64 status see https://bugzilla.mozilla.org/show_bug.cgi?id=1678342')
13-
return
11+
const architecture = process.arch
12+
let platform
13+
14+
switch (architecture) {
15+
case 'x64':
16+
platform = 'linux-x86_64'
17+
break
18+
case 'arm64':
19+
platform = 'linux-aarch64'
20+
if (firefoxVersion >= '136.0') {
21+
break
22+
}
23+
else {
24+
console.log(`Firefox ${firefoxVersion} not available for arm64, minimum 136.0 required, skipping download`)
25+
return
26+
}
27+
default:
28+
console.log(`Unsupported architecture ${architecture} for Firefox, skipping download`)
29+
return
1430
}
1531

32+
console.log(`Installing Firefox version ${firefoxVersion} for ${architecture}`)
33+
1634
// Change in compression from bz2 to xz in Firefox 135.0
1735
// See https://www.mozilla.org/en-US/firefox/135.0/releasenotes/
1836

@@ -22,10 +40,8 @@ if (firefoxVersion >= '135.0') {
2240
compression = `xz`
2341
}
2442

25-
console.log('Installing Firefox version: ', firefoxVersion)
26-
2743
// Insert logic here if needed to run a different install script based on chrome version.
28-
const install = spawn(`${__dirname}/default.sh`, [firefoxVersion, compression], {stdio: 'inherit'})
44+
const install = spawn(`${__dirname}/default.sh`, [firefoxVersion, compression, platform], { stdio: 'inherit' })
2945

3046
install.on('error', function (error) {
3147
console.log('child process errored with ' + error.toString())

0 commit comments

Comments
 (0)