Skip to content

Commit 48021a7

Browse files
authored
Build: Really test on Firefox ESR, new & old; simplify cache
The previous config declared Firefox ESR testing, but the tests were never run due to clashing names with main Firefox test runs. Apart from fixing that, backport jquery/jquery#5682 so that both Firefox ESR versions can be downloaded despite using different compression algorithms. Also, Simplify caching in CI: our setup is pretty standard, so manual configuration of `actions/cache` is an overkill. Relying on built-in `actions/node` caching will also resolve differences between caching configurations for macOS/Linux vs. Windows. Closes gh-597 Ref gh-598 Ref jquery/jquery#5682
1 parent e28ef35 commit 48021a7

File tree

4 files changed

+22
-51
lines changed

4 files changed

+22
-51
lines changed

.github/workflows/browser-tests.yml

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@ env:
1212
jobs:
1313
test:
1414
runs-on: ubuntu-latest
15-
name: ${{ matrix.BROWSER }} (${{ matrix.MIGRATE_VERSION }} Migrate)
15+
name: ${{ matrix.NAME || matrix.BROWSER }} (${{ matrix.MIGRATE_VERSION }} Migrate)
1616
strategy:
1717
fail-fast: false
1818
matrix:
19+
NAME: [""]
1920
BROWSER: ["chrome", "firefox"]
2021
MIGRATE_VERSION: ["min"]
2122
include:
22-
- NAME: "Node"
23+
- NAME: ""
2324
BROWSER: "chrome"
2425
MIGRATE_VERSION: "esmodules"
2526
- NAME: "Firefox ESR (new)"
@@ -36,14 +37,8 @@ jobs:
3637
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
3738
with:
3839
node-version: ${{ env.NODE_VERSION }}
39-
40-
- name: Cache
41-
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
42-
with:
43-
path: ~/.npm
44-
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
45-
restore-keys: |
46-
${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-
40+
cache: npm
41+
cache-dependency-path: '**/package-lock.json'
4742

4843
- name: Set download URL for Firefox ESR (old)
4944
run: |
@@ -57,7 +52,13 @@ jobs:
5752

5853
- name: Install Firefox ESR
5954
run: |
60-
wget --no-verbose $FIREFOX_SOURCE_URL -O - | tar -jx -C ${HOME}
55+
# Support: Firefox <135 only
56+
# Older Firefox used to be compressed using bzip2, newer using xz. Try
57+
# to uncompress using xz, fall back to bzip2 if that fails.
58+
# Note: this will download the old Firefox ESR twice, but it will still work
59+
# when the current ESR version starts to use xz with no changes to the code.
60+
wget --no-verbose "$FIREFOX_SOURCE_URL" -O - | tar -Jx -C "$HOME" || \
61+
wget --no-verbose "$FIREFOX_SOURCE_URL" -O - | tar -jx -C "$HOME"
6162
echo "PATH=${HOME}/firefox:$PATH" >> "$GITHUB_ENV"
6263
echo "FIREFOX_BIN=${HOME}/firefox/firefox" >> "$GITHUB_ENV"
6364
if: contains(matrix.NAME, 'Firefox ESR')
@@ -85,14 +86,8 @@ jobs:
8586
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
8687
with:
8788
node-version: ${{ env.NODE_VERSION }}
88-
89-
- name: Cache
90-
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
91-
with:
92-
path: ~/.npm
93-
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
94-
restore-keys: |
95-
${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-
89+
cache: npm
90+
cache-dependency-path: '**/package-lock.json'
9691

9792
- name: Install dependencies
9893
run: npm install
@@ -114,14 +109,8 @@ jobs:
114109
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
115110
with:
116111
node-version: ${{ env.NODE_VERSION }}
117-
118-
- name: Cache
119-
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
120-
with:
121-
path: ~/.npm
122-
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
123-
restore-keys: |
124-
${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-
112+
cache: npm
113+
cache-dependency-path: '**/package-lock.json'
125114

126115
- name: Install dependencies
127116
run: npm install

.github/workflows/browserstack.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,8 @@ jobs:
5151
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
5252
with:
5353
node-version: ${{ env.NODE_VERSION }}
54-
55-
- name: Cache
56-
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
57-
with:
58-
path: ~/.npm
59-
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
60-
restore-keys: |
61-
${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-
54+
cache: npm
55+
cache-dependency-path: '**/package-lock.json'
6256

6357
- name: Install dependencies
6458
run: npm install

.github/workflows/filestash.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,8 @@ jobs:
2323
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
2424
with:
2525
node-version: ${{ env.NODE_VERSION }}
26-
27-
- name: Cache
28-
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
29-
with:
30-
path: ~/.npm
31-
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
32-
restore-keys: |
33-
${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-
26+
cache: npm
27+
cache-dependency-path: '**/package-lock.json'
3428

3529
- name: Install dependencies
3630
run: npm install

.github/workflows/node.js.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,8 @@ jobs:
2727
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
2828
with:
2929
node-version: ${{ matrix.NODE_VERSION }}
30-
31-
- name: Cache
32-
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
33-
with:
34-
path: ~/.npm
35-
key: ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
36-
restore-keys: |
37-
${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-npm-lock-
30+
cache: npm
31+
cache-dependency-path: '**/package-lock.json'
3832

3933
- name: Install dependencies
4034
run: npm install

0 commit comments

Comments
 (0)