🌐 AI搜索 & 代理 主页
Skip to content

Commit cb4bf18

Browse files
committed
Build: Add periodic tests on beta versions of browsers
Run weekly tests on the following browsers: * Chrome beta * Firefox beta * Safari Technology Preview Don't fail the job in case of failures to avoid jQuery being marked as failing CI in case of a beta browser bug. In such cases, print a summary about errors to the job. Closes gh-5733 (cherry picked from commit c28c26a)
1 parent bea51d0 commit cb4bf18

File tree

3 files changed

+130
-9
lines changed

3 files changed

+130
-9
lines changed
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
name: Browser Tests (Beta)
2+
3+
on:
4+
schedule:
5+
# Run weekly on Sunday at 3 AM UTC to catch beta browser updates
6+
- cron: '0 3 * * 0'
7+
workflow_dispatch:
8+
# Allow manual triggering from the Actions tab
9+
10+
permissions:
11+
contents: read # to fetch code (actions/checkout)
12+
13+
env:
14+
NODE_VERSION: 24.x
15+
16+
jobs:
17+
chrome-beta:
18+
runs-on: ubuntu-latest
19+
name: Chrome Beta
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
23+
24+
- name: Use Node.js ${{ env.NODE_VERSION }}
25+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
26+
with:
27+
node-version: ${{ env.NODE_VERSION }}
28+
cache: npm
29+
cache-dependency-path: '**/package-lock.json'
30+
31+
- name: Install Chrome Beta
32+
run: |
33+
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
34+
echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee /etc/apt/sources.list.d/google-chrome.list
35+
sudo apt-get update
36+
sudo apt-get install -y google-chrome-beta
37+
38+
- name: Set Chrome Beta as default
39+
run: |
40+
echo "CHROME_BIN=$(which google-chrome-beta)" >> "$GITHUB_ENV"
41+
google-chrome-beta --version
42+
echo "Chrome Beta installed at: $(which google-chrome-beta)"
43+
44+
- name: Install dependencies
45+
run: npm ci
46+
47+
- name: Run Chrome Beta tests
48+
id: run-chrome-tests
49+
run: npm run test:chrome
50+
continue-on-error: true # Beta browsers may have bugs
51+
52+
firefox-beta:
53+
runs-on: ubuntu-latest
54+
name: Firefox Beta
55+
steps:
56+
- name: Checkout
57+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
58+
59+
- name: Use Node.js ${{ env.NODE_VERSION }}
60+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
61+
with:
62+
node-version: ${{ env.NODE_VERSION }}
63+
cache: npm
64+
cache-dependency-path: '**/package-lock.json'
65+
66+
- name: Install Firefox Beta
67+
run: |
68+
wget --no-verbose "https://download.mozilla.org/?product=firefox-beta-latest-ssl&lang=en-US&os=linux64" -O - | tar -Jx -C "$HOME"
69+
70+
- name: Set Firefox Beta as default
71+
run: |
72+
echo "PATH=${HOME}/firefox:$PATH" >> "$GITHUB_ENV"
73+
echo "FIREFOX_BIN=${HOME}/firefox/firefox" >> "$GITHUB_ENV"
74+
"$HOME/firefox/firefox" --version
75+
echo "Firefox Beta installed at: $HOME/firefox/firefox"
76+
77+
- name: Install dependencies
78+
run: npm ci
79+
80+
- name: Run Firefox Beta tests
81+
id: run-firefox-tests
82+
run: npm run test:firefox
83+
continue-on-error: true # Beta browsers may have bugs
84+
85+
safari-tp:
86+
runs-on: macos-latest
87+
name: Safari Technology Preview
88+
steps:
89+
- name: Checkout
90+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
91+
92+
- name: Use Node.js ${{ env.NODE_VERSION }}
93+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
94+
with:
95+
node-version: ${{ env.NODE_VERSION }}
96+
cache: npm
97+
cache-dependency-path: '**/package-lock.json'
98+
99+
- name: Install Safari Technology Preview
100+
run: |
101+
# Install Safari Technology Preview via Homebrew Cask
102+
brew install --cask safari-technology-preview
103+
104+
# Verify installation
105+
if [ -d "/Applications/Safari Technology Preview.app" ]; then
106+
echo "Safari Technology Preview installed successfully"
107+
else
108+
echo "Safari TP installation verification failed"
109+
exit 1
110+
fi
111+
112+
- name: Enable Safari Technology Preview driver
113+
run: sudo /Applications/Safari\ Technology\ Preview.app/Contents/MacOS/safaridriver --enable
114+
115+
- name: Install dependencies
116+
run: npm ci
117+
118+
- name: Run Safari Technology Preview tests
119+
id: run-safari-tests
120+
run: npm run test:safari -- --safari-tp
121+
continue-on-error: true # Beta browsers may have bugs

package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@
7777
"eslint-config-jquery": "3.0.2",
7878
"globals": "16.5.0",
7979
"husky": "9.1.7",
80+
"jquery-test-runner": "0.3.0",
8081
"jsdom": "27.2.0",
81-
"jquery-test-runner": "0.2.8",
8282
"marked": "17.0.0",
8383
"native-promise-only": "0.8.1",
8484
"nodemon": "3.1.11",

0 commit comments

Comments
 (0)