Skip to content

Commit 253de08

Browse files
committed
Build: Improve actions setup for PRs
Improve the actions setup for PRs so that more issues are detected pre-merge. Changes: 1. Test on Edge in IE mode 2. Test on more jQuery versions: `git`, `3.x-git`, `3.7.1` & their slim versions as well as full versions of each `3.x` jQuery minor. This is still fewer tests than post-merge: we don't test all slim versions and Migrate dev, but this should cover the majority of cases.
1 parent 77e2245 commit 253de08

File tree

4 files changed

+142
-71
lines changed

4 files changed

+142
-71
lines changed

Diff for: .github/workflows/browsers-local.yml

+125
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
name: Browsers - local
2+
3+
on:
4+
pull_request:
5+
6+
env:
7+
NODE_VERSION: 20.x
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
name: ${{ matrix.MIGRATE_VERSION }} (Chrome/Firefox)
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
MIGRATE_VERSION: ["min"]
17+
include:
18+
- MIGRATE_VERSION: "esmodules"
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
22+
23+
- name: Use Node.js ${{ env.NODE_VERSION }}
24+
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
25+
with:
26+
node-version: ${{ env.NODE_VERSION }}
27+
28+
- name: Cache
29+
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
30+
with:
31+
path: ~/.npm
32+
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
33+
restore-keys: |
34+
${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-
35+
36+
- name: Install dependencies
37+
run: npm install
38+
39+
- name: Run tests
40+
run: |
41+
npm run test:browser -- \
42+
--jquery-migrate ${{ matrix.MIGRATE_VERSION }} \
43+
--jquery git --jquery git.min --jquery git.slim --jquery git.slim.min \
44+
--jquery 3.x-git --jquery 3.x-git.min --jquery 3.x-git.slim --jquery 3.x-git.slim.min \
45+
--jquery 3.7.1 --jquery 3.7.1.slim \
46+
--jquery 3.6.4 --jquery 3.5.1 --jquery 3.4.1 \
47+
--jquery 3.3.1 --jquery 3.2.1 --jquery 3.1.1 --jquery 3.0.0 \
48+
--retries 3 --hard-retries 1
49+
50+
ie:
51+
runs-on: windows-latest
52+
name: ${{ matrix.MIGRATE_VERSION }} (Edge in IE mode)
53+
shell: cmd
54+
strategy:
55+
fail-fast: false
56+
matrix:
57+
MIGRATE_VERSION: [ "min" ]
58+
steps:
59+
- name: Checkout
60+
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
61+
62+
- name: Use Node.js ${{ env.NODE_VERSION }}
63+
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
64+
with:
65+
node-version: ${{ env.NODE_VERSION }}
66+
67+
- name: Cache
68+
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
69+
with:
70+
path: ~/.npm
71+
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
72+
restore-keys: |
73+
${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-
74+
75+
- name: Install dependencies
76+
run: npm install
77+
78+
- name: Run tests
79+
run: |
80+
npm run test:ie -- ^
81+
--jquery-migrate ${{ matrix.MIGRATE_VERSION }} ^
82+
--jquery git --jquery git.min --jquery git.slim --jquery git.slim.min ^
83+
--jquery 3.x-git --jquery 3.x-git.min --jquery 3.x-git.slim --jquery 3.x-git.slim.min ^
84+
--jquery 3.7.1 --jquery 3.7.1.slim ^
85+
--jquery 3.6.4 --jquery 3.5.1 --jquery 3.4.1 ^
86+
--jquery 3.3.1 --jquery 3.2.1 --jquery 3.1.1 --jquery 3.0.0 ^
87+
--retries 3 --hard-retries 1
88+
89+
safari:
90+
runs-on: macos-latest
91+
name: ${{ matrix.MIGRATE_VERSION }} (Safari)
92+
strategy:
93+
fail-fast: false
94+
matrix:
95+
MIGRATE_VERSION: ["min"]
96+
steps:
97+
- name: Checkout
98+
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
99+
100+
- name: Use Node.js ${{ env.NODE_VERSION }}
101+
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
102+
with:
103+
node-version: ${{ env.NODE_VERSION }}
104+
105+
- name: Cache
106+
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
107+
with:
108+
path: ~/.npm
109+
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
110+
restore-keys: |
111+
${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-
112+
113+
- name: Install dependencies
114+
run: npm install
115+
116+
- name: Run tests
117+
run: |
118+
npm run test:safari -- \
119+
--jquery-migrate ${{ matrix.MIGRATE_VERSION }} \
120+
--jquery git --jquery git.min --jquery git.slim --jquery git.slim.min \
121+
--jquery 3.x-git --jquery 3.x-git.min --jquery 3.x-git.slim --jquery 3.x-git.slim.min \
122+
--jquery 3.7.1 --jquery 3.7.1.slim \
123+
--jquery 3.6.4 --jquery 3.5.1 --jquery 3.4.1 \
124+
--jquery 3.3.1 --jquery 3.2.1 --jquery 3.1.1 --jquery 3.0.0 \
125+
--retries 3 --hard-retries 1

Diff for: .github/workflows/node.js.yml

-68
Original file line numberDiff line numberDiff line change
@@ -34,71 +34,3 @@ jobs:
3434

3535
- name: Run Node smoke tests
3636
run: npm run test:node_smoke_tests
37-
38-
test:
39-
runs-on: ubuntu-latest
40-
name: ${{ matrix.MIGRATE_VERSION }} - jQuery ${{ matrix.JQUERY_VERSION }} (Chrome/Firefox)
41-
strategy:
42-
fail-fast: false
43-
matrix:
44-
MIGRATE_VERSION: ["min"]
45-
JQUERY_VERSION: ["git.min", "git.slim.min", "3.x-git.min", "3.x-git.slim.min"]
46-
include:
47-
- MIGRATE_VERSION: "esmodules"
48-
JQUERY_VERSION: "3.x-git.slim.min"
49-
steps:
50-
- name: Checkout
51-
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
52-
53-
- name: Use Node.js ${{ env.NODE_VERSION }}
54-
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
55-
with:
56-
node-version: ${{ env.NODE_VERSION }}
57-
58-
- name: Cache
59-
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
60-
with:
61-
path: ~/.npm
62-
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
63-
restore-keys: |
64-
${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-
65-
66-
- name: Install dependencies
67-
run: npm install
68-
69-
- name: Run tests
70-
run: npm run test:browser -- --jquery-migrate=${{ matrix.MIGRATE_VERSION }} --jquery=${{ matrix.JQUERY_VERSION }}
71-
72-
safari:
73-
runs-on: macos-latest
74-
name: ${{ matrix.MIGRATE_VERSION }} - jQuery ${{ matrix.JQUERY_VERSION }} (Safari)
75-
strategy:
76-
fail-fast: false
77-
matrix:
78-
MIGRATE_VERSION: ["min"]
79-
JQUERY_VERSION: ["git.min", "git.slim.min", "3.x-git.min", "3.x-git.slim.min"]
80-
steps:
81-
- name: Checkout
82-
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
83-
84-
- name: Use Node.js ${{ env.NODE_VERSION }}
85-
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
86-
with:
87-
node-version: ${{ env.NODE_VERSION }}
88-
89-
- name: Cache
90-
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
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-
96-
97-
- name: Install dependencies
98-
run: npm install
99-
100-
- name: Run tests
101-
run: |
102-
npm run test:safari -- \
103-
--jquery-migrate=${{ matrix.MIGRATE_VERSION }} \
104-
--jquery=${{ matrix.JQUERY_VERSION }}

Diff for: package.json

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"pretest": "npm run npmcopy && npm run build && npm run lint",
2727
"start": "npm run npmcopy && node build/tasks/build-watch.js",
2828
"test:browser": "npm run pretest && npm run test:unit -- -b chrome -b firefox -h",
29+
"test:ie": "npm run pretest && npm run test:unit -- -v -b ie",
2930
"test:node_smoke_tests": "npm run pretest && node test/node_smoke_tests/smoke_tests.cjs",
3031
"test:safari": "npm run pretest && npm run test:unit -- -v -b safari",
3132
"test:server": "node test/runner/server.js",

Diff for: test/runner/selenium/createDriver.js

+16-3
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,24 @@ import { Builder, Capabilities, logging } from "selenium-webdriver";
22
import Chrome from "selenium-webdriver/chrome.js";
33
import Edge from "selenium-webdriver/edge.js";
44
import Firefox from "selenium-webdriver/firefox.js";
5+
import IE from "selenium-webdriver/ie.js";
56
import { browserSupportsHeadless } from "../lib/getBrowserString.js";
67

78
// Set script timeout to 10min
89
const DRIVER_SCRIPT_TIMEOUT = 1000 * 60 * 10;
910

1011
export default async function createDriver( { browserName, headless, url, verbose } ) {
1112
const capabilities = Capabilities[ browserName ]();
12-
const prefs = new logging.Preferences();
13-
prefs.setLevel( logging.Type.BROWSER, logging.Level.ALL );
14-
capabilities.setLoggingPrefs( prefs );
13+
14+
// Support: IE 11+
15+
// When those are set for IE, the process crashes with an error:
16+
// "Unable to match capability set 0: goog:loggingPrefs is an unknown
17+
// extension capability for IE".
18+
if ( browserName !== "ie" ) {
19+
const prefs = new logging.Preferences();
20+
prefs.setLevel( logging.Type.BROWSER, logging.Level.ALL );
21+
capabilities.setLoggingPrefs( prefs );
22+
}
1523

1624
let driver = new Builder().withCapabilities( capabilities );
1725

@@ -49,6 +57,10 @@ export default async function createDriver( { browserName, headless, url, verbos
4957
edgeOptions.setEdgeChromiumBinaryPath( process.env.EDGE_BIN );
5058
}
5159

60+
const ieOptions = new IE.Options();
61+
ieOptions.setEdgeChromium( true );
62+
ieOptions.setEdgePath( "C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe" );
63+
5264
if ( headless ) {
5365
chromeOptions.addArguments( "--headless=new" );
5466
firefoxOptions.addArguments( "--headless" );
@@ -65,6 +77,7 @@ export default async function createDriver( { browserName, headless, url, verbos
6577
.setChromeOptions( chromeOptions )
6678
.setFirefoxOptions( firefoxOptions )
6779
.setEdgeOptions( edgeOptions )
80+
.setIeOptions( ieOptions )
6881
.build();
6982

7083
if ( verbose ) {

0 commit comments

Comments
 (0)